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.
420 421 422 |
# File 'lib/etna/clients/magma/models.rb', line 420 def initialize(raw = {}) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
418 419 420 |
# File 'lib/etna/clients/magma/models.rb', line 418 def raw @raw end |
Instance Method Details
#all ⇒ Object
437 438 439 |
# File 'lib/etna/clients/magma/models.rb', line 437 def all raw.values.map { |r| Attribute.new(r) } end |
#attribute(attribute_key) ⇒ Object
428 429 430 431 |
# File 'lib/etna/clients/magma/models.rb', line 428 def attribute(attribute_key) return nil unless raw.include?(attribute_key) Attribute.new(raw[attribute_key]) end |
#attribute_keys ⇒ Object
424 425 426 |
# File 'lib/etna/clients/magma/models.rb', line 424 def attribute_keys raw.keys end |