Module: Taksi::Component::InstanceMethods
- Defined in:
- lib/taksi/component.rb
Instance Attribute Summary collapse
-
#datasource ⇒ Object
readonly
Returns the value of attribute datasource.
-
#interface_definition ⇒ Object
readonly
Returns the value of attribute interface_definition.
-
#skeleton ⇒ Object
readonly
Returns the value of attribute skeleton.
Instance Method Summary collapse
Instance Attribute Details
#datasource ⇒ Object (readonly)
Returns the value of attribute datasource.
37 38 39 |
# File 'lib/taksi/component.rb', line 37 def datasource @datasource end |
#interface_definition ⇒ Object (readonly)
Returns the value of attribute interface_definition.
37 38 39 |
# File 'lib/taksi/component.rb', line 37 def interface_definition @interface_definition end |
#skeleton ⇒ Object (readonly)
Returns the value of attribute skeleton.
37 38 39 |
# File 'lib/taksi/component.rb', line 37 def skeleton @skeleton end |
Instance Method Details
#content_for(interface) ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/taksi/component.rb', line 51 def content_for(interface) data = interface.send(datasource) skeleton.fields.each_with_object({}) do |field, obj| load_data_from_key_to_object(data, field, obj) end end |
#id ⇒ Object
47 48 49 |
# File 'lib/taksi/component.rb', line 47 def id @skeleton.id end |
#initialize(interface_definition, with: nil) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/taksi/component.rb', line 39 def initialize(interface_definition, with: nil) @interface_definition = interface_definition @datasource = with @skeleton = @interface_definition.skeleton.create_component(self.class.identifier, &self.class.content_builder) super() end |