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.
473 474 475 |
# File 'lib/etna/clients/magma/models.rb', line 473 def initialize(raw = {}) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
471 472 473 |
# File 'lib/etna/clients/magma/models.rb', line 471 def raw @raw end |
Instance Method Details
#all ⇒ Object
490 491 492 |
# File 'lib/etna/clients/magma/models.rb', line 490 def all raw.values.map { |r| Attribute.new(r) } end |
#attribute(attribute_key) ⇒ Object
481 482 483 484 |
# File 'lib/etna/clients/magma/models.rb', line 481 def attribute(attribute_key) return nil unless raw.include?(attribute_key.to_s) Attribute.new(raw[attribute_key.to_s]) end |
#attribute_keys ⇒ Object
477 478 479 |
# File 'lib/etna/clients/magma/models.rb', line 477 def attribute_keys raw.keys end |