Class: Zona::Zone
- Inherits:
-
OZonesElement
- Object
- JSONElement
- OZonesElement
- Zona::Zone
- Defined in:
- zona/ZoneElement.rb
Overview
This class describes a single OZones Zone element. It can be used to allocate, delete and retrieve full information for a Zone.
Constant Summary
- ZONE_KIND =
String describing the kind of this resource
"zone"
Instance Attribute Summary
Attributes inherited from OZonesElement
Class Method Summary (collapse)
-
+ (Hash, Zona::Error) build_json(pe_id = nil)
Builds minimal JSON description for a Zone.
Instance Method Summary (collapse)
-
- (Zona::Error) allocate(template)
Allocates a new element from a JSON description.
-
- (Zona::Error) allocate_hash(template)
Allocates a new element from a hash description.
-
- (Zona::Error) delete
Deletes current element.
-
- (Zona::Error) info
Retrieves details about this object and fills in the information hash.
-
- (String) initialize(hash, client)
constructor
Initializes a Zone object instance.
Methods inherited from OZonesElement
Methods inherited from JSONElement
Constructor Details
- (String) initialize(hash, client)
Initializes a Zone object instance
43 44 45 |
# File 'zona/ZoneElement.rb', line 43 def initialize(hash, client) super(hash, client) end |
Class Method Details
+ (Hash, Zona::Error) build_json(pe_id = nil)
Builds minimal JSON description for a Zone
30 31 32 33 34 35 36 37 |
# File 'zona/ZoneElement.rb', line 30 def self.build_json(pe_id=nil) if pe_id json = "{\"ZONE\":{\"ID\":#{pe_id}}}" else json = '{"ZONE":{}}' end OZonesJSON.build_json(json,:ZONE) end |
Instance Method Details
- (Zona::Error) allocate(template)
Allocates a new element from a JSON description
64 65 66 |
# File 'zona/ZoneElement.rb', line 64 def allocate(template) super(ZONE_KIND,template) end |
- (Zona::Error) allocate_hash(template)
Allocates a new element from a hash description
57 58 59 |
# File 'zona/ZoneElement.rb', line 57 def allocate_hash(template) super(ZONE_KIND,template) end |
- (Zona::Error) delete
Deletes current element
70 71 72 |
# File 'zona/ZoneElement.rb', line 70 def delete super(ZONE_KIND) end |
- (Zona::Error) info
Retrieves details about this object and fills in the information hash
50 51 52 |
# File 'zona/ZoneElement.rb', line 50 def info super(ZONE_KIND,:ZONE) end |