Class: Etna::Clients::Magma::Template
- Inherits:
-
Object
- Object
- Etna::Clients::Magma::Template
- 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_linked_model_names ⇒ Object
- #attributes ⇒ Object
- #build_attributes ⇒ Object
- #identifier ⇒ Object
- #identifier=(val) ⇒ Object
-
#initialize(raw = {}) ⇒ Template
constructor
A new instance of Template.
- #name ⇒ Object
- #name=(val) ⇒ Object
- #parent ⇒ Object
- #parent=(val) ⇒ Object
- #version ⇒ Object
- #version=(val) ⇒ Object
Constructor Details
#initialize(raw = {}) ⇒ Template
Returns a new instance of Template.
327 328 329 |
# File 'lib/etna/clients/magma/models.rb', line 327 def initialize(raw = {}) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
325 326 327 |
# File 'lib/etna/clients/magma/models.rb', line 325 def raw @raw end |
Instance Method Details
#all_linked_model_names ⇒ Object
371 372 373 374 |
# File 'lib/etna/clients/magma/models.rb', line 371 def all_linked_model_names models = [ self.parent, ] + build_attributes.all.map { |v| v.link_model_name } models.select { |m| !m.nil? }.uniq end |
#attributes ⇒ Object
363 364 365 |
# File 'lib/etna/clients/magma/models.rb', line 363 def attributes Attributes.new(raw['attributes'] ||= {}) end |
#build_attributes ⇒ Object
367 368 369 |
# File 'lib/etna/clients/magma/models.rb', line 367 def build_attributes Attributes.new(raw['attributes'] ||= {}) end |
#identifier ⇒ Object
339 340 341 |
# File 'lib/etna/clients/magma/models.rb', line 339 def identifier raw['identifier'] || "" end |
#identifier=(val) ⇒ Object
351 352 353 |
# File 'lib/etna/clients/magma/models.rb', line 351 def identifier=(val) raw['identifier'] = val end |
#name ⇒ Object
331 332 333 |
# File 'lib/etna/clients/magma/models.rb', line 331 def name raw['name'] || "" end |
#name=(val) ⇒ Object
335 336 337 |
# File 'lib/etna/clients/magma/models.rb', line 335 def name=(val) raw['name'] = val.to_s end |
#parent ⇒ Object
355 356 357 |
# File 'lib/etna/clients/magma/models.rb', line 355 def parent raw['parent'] end |
#parent=(val) ⇒ Object
359 360 361 |
# File 'lib/etna/clients/magma/models.rb', line 359 def parent=(val) raw['parent'] = val end |
#version ⇒ Object
343 344 345 |
# File 'lib/etna/clients/magma/models.rb', line 343 def version raw['version'] || 0 end |
#version=(val) ⇒ Object
347 348 349 |
# File 'lib/etna/clients/magma/models.rb', line 347 def version=(val) raw['version'] = val end |