Class: Proteus::ComponentInstance
- Inherits:
-
Object
- Object
- Proteus::ComponentInstance
- Defined in:
- lib/ComponentInstance.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
————————————————————————— Properties —————————————————————————.
-
#kind ⇒ Object
————————————————————————— Properties —————————————————————————.
-
#properties ⇒ Object
————————————————————————— Properties —————————————————————————.
Instance Method Summary collapse
-
#final_children ⇒ Object
Merges the component’s children with the class’s and returns the result.
-
#final_properties ⇒ Object
Merges the component’s properties with the class’s and returns the result.
-
#initialize(kind = ComponentClass::DEFAULT_CLASS, properties = {}, children = []) ⇒ ComponentInstance
constructor
————————————————————————— Constructor —————————————————————————.
Constructor Details
#initialize(kind = ComponentClass::DEFAULT_CLASS, properties = {}, children = []) ⇒ ComponentInstance
Constructor
36 37 38 39 40 41 42 43 |
# File 'lib/ComponentInstance.rb', line 36 def initialize( kind = ComponentClass::DEFAULT_CLASS, properties = {}, children = [] ) @kind = kind @properties = properties @children = children end |
Instance Attribute Details
#children ⇒ Object
Properties
51 52 53 |
# File 'lib/ComponentInstance.rb', line 51 def children @children end |
#kind ⇒ Object
Properties
51 52 53 |
# File 'lib/ComponentInstance.rb', line 51 def kind @kind end |
#properties ⇒ Object
Properties
51 52 53 |
# File 'lib/ComponentInstance.rb', line 51 def properties @properties end |
Instance Method Details
#final_children ⇒ Object
Merges the component’s children with the class’s and returns the result.
69 70 71 |
# File 'lib/ComponentInstance.rb', line 69 def final_children return kind.children.merge( @children ) end |
#final_properties ⇒ Object
Merges the component’s properties with the class’s and returns the result.
62 63 64 |
# File 'lib/ComponentInstance.rb', line 62 def final_properties return kind.properties.merge( @properties ) end |