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
- #build_dictionary ⇒ Object
- #dictionary ⇒ 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
- #template_model_name ⇒ Object
- #template_project_name ⇒ Object
- #version ⇒ Object
- #version=(val) ⇒ Object
Constructor Details
#initialize(raw = {}) ⇒ Template
Returns a new instance of Template.
368 369 370 |
# File 'lib/etna/clients/magma/models.rb', line 368 def initialize(raw = {}) @raw = raw end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
366 367 368 |
# File 'lib/etna/clients/magma/models.rb', line 366 def raw @raw end |
Instance Method Details
#all_linked_model_names ⇒ Object
428 429 430 431 |
# File 'lib/etna/clients/magma/models.rb', line 428 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
404 405 406 |
# File 'lib/etna/clients/magma/models.rb', line 404 def attributes Attributes.new(raw['attributes'] ||= {}) end |
#build_attributes ⇒ Object
416 417 418 |
# File 'lib/etna/clients/magma/models.rb', line 416 def build_attributes Attributes.new(raw['attributes'] ||= {}) end |
#build_dictionary ⇒ Object
424 425 426 |
# File 'lib/etna/clients/magma/models.rb', line 424 def build_dictionary Dictionary.new(raw['dictionary'] ||= {}) end |
#dictionary ⇒ Object
420 421 422 |
# File 'lib/etna/clients/magma/models.rb', line 420 def dictionary Dictionary.new(raw['dictionary'] ||= {}) end |
#identifier ⇒ Object
380 381 382 |
# File 'lib/etna/clients/magma/models.rb', line 380 def identifier raw['identifier'] || "" end |
#identifier=(val) ⇒ Object
392 393 394 |
# File 'lib/etna/clients/magma/models.rb', line 392 def identifier=(val) raw['identifier'] = val end |
#name ⇒ Object
372 373 374 |
# File 'lib/etna/clients/magma/models.rb', line 372 def name raw['name'] || "" end |
#name=(val) ⇒ Object
376 377 378 |
# File 'lib/etna/clients/magma/models.rb', line 376 def name=(val) raw['name'] = val.to_s end |
#parent ⇒ Object
396 397 398 |
# File 'lib/etna/clients/magma/models.rb', line 396 def parent raw['parent'] end |
#parent=(val) ⇒ Object
400 401 402 |
# File 'lib/etna/clients/magma/models.rb', line 400 def parent=(val) raw['parent'] = val end |
#template_model_name ⇒ Object
412 413 414 |
# File 'lib/etna/clients/magma/models.rb', line 412 def template_model_name raw['template_model_name'] end |
#template_project_name ⇒ Object
408 409 410 |
# File 'lib/etna/clients/magma/models.rb', line 408 def template_project_name raw['template_project_name'] end |
#version ⇒ Object
384 385 386 |
# File 'lib/etna/clients/magma/models.rb', line 384 def version raw['version'] || 0 end |
#version=(val) ⇒ Object
388 389 390 |
# File 'lib/etna/clients/magma/models.rb', line 388 def version=(val) raw['version'] = val end |