Class: Etna::Clients::Magma::Attributes
- Inherits:
-
Object
- Object
- Etna::Clients::Magma::Attributes
- Defined in:
- lib/etna/clients/magma/models.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #all ⇒ Object
- #attribute(attribute_key) ⇒ Object
- #attribute_keys ⇒ Object
- #build_attribute(key) ⇒ Object
-
#initialize(raw = {}) ⇒ Attributes
constructor
A new instance of Attributes.
Constructor Details
#initialize(raw = {}) ⇒ Attributes
Returns a new instance of Attributes.
431 432 433 |
# File 'lib/etna/clients/magma/models.rb', line 431 def initialize(raw = {}) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
429 430 431 |
# File 'lib/etna/clients/magma/models.rb', line 429 def raw @raw end |
Instance Method Details
#all ⇒ Object
448 449 450 |
# File 'lib/etna/clients/magma/models.rb', line 448 def all raw.values.map { |r| Attribute.new(r) } end |
#attribute(attribute_key) ⇒ Object
439 440 441 442 |
# File 'lib/etna/clients/magma/models.rb', line 439 def attribute(attribute_key) return nil unless raw.include?(attribute_key.to_s) Attribute.new(raw[attribute_key.to_s]) end |
#attribute_keys ⇒ Object
435 436 437 |
# File 'lib/etna/clients/magma/models.rb', line 435 def attribute_keys raw.keys end |