Class: Archimate::FileFormats::Sax::ModelExchangeFile::Color

Inherits:
Handler
  • Object
show all
Defined in:
lib/archimate/file_formats/sax/model_exchange_file/color.rb

Instance Attribute Summary

Attributes inherited from Handler

#attrs, #element_type, #name, #parent_handler

Instance Method Summary collapse

Methods inherited from Handler

#characters, #diagram, #event, #method_missing, #process_text, #property_definitions, #respond_to_missing?

Constructor Details

#initialize(name, attrs, parent_handler) ⇒ Color

Returns a new instance of Color.



8
9
10
# File 'lib/archimate/file_formats/sax/model_exchange_file/color.rb', line 8

def initialize(name, attrs, parent_handler)
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Archimate::FileFormats::Sax::Handler

Instance Method Details

#completeObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/archimate/file_formats/sax/model_exchange_file/color.rb', line 12

def complete
  [
    event(
      event_name,
      DataModel::Color.new(
        %w[r g b a].each_with_object({}) { |attr, hash| hash[attr.to_sym] = attrs[attr]&.to_i }
      )
    )
  ]
end