Class: Proteus::ComponentInstance

Inherits:
Object
  • Object
show all
Defined in:
lib/ComponentInstance.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#childrenObject


Properties



51
52
53
# File 'lib/ComponentInstance.rb', line 51

def children
  @children
end

#kindObject


Properties



51
52
53
# File 'lib/ComponentInstance.rb', line 51

def kind
  @kind
end

#propertiesObject


Properties



51
52
53
# File 'lib/ComponentInstance.rb', line 51

def properties
  @properties
end

Instance Method Details

#final_childrenObject

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_propertiesObject

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