Module: Glia::Cell
- Defined in:
- lib/glia/cell.rb
Instance Attribute Summary collapse
-
#blocks ⇒ Object
Returns the value of attribute blocks.
-
#child_definitions ⇒ Object
Returns the value of attribute child_definitions.
-
#layout ⇒ Object
Returns the value of attribute layout.
Instance Method Summary collapse
- #cell(code, *args) ⇒ Object
-
#children ⇒ Object
To be overloaded, but here to prevent errors if we don’t define initialize def initialize(config) end.
- #themes ⇒ Object
Instance Attribute Details
#blocks ⇒ Object
Returns the value of attribute blocks.
3 4 5 |
# File 'lib/glia/cell.rb', line 3 def blocks @blocks end |
#child_definitions ⇒ Object
Returns the value of attribute child_definitions.
3 4 5 |
# File 'lib/glia/cell.rb', line 3 def child_definitions @child_definitions end |
#layout ⇒ Object
Returns the value of attribute layout.
3 4 5 |
# File 'lib/glia/cell.rb', line 3 def layout @layout end |
Instance Method Details
#cell(code, *args) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/glia/cell.rb', line 15 def cell(code, *args) @children ||= {} name = child_definitions[code] raise Errors::MissingCellError, "No child cell in position #{code}" if name.nil? @children[code] ||= layout.cell(name, *args) end |
#children ⇒ Object
To be overloaded, but here to prevent errors if we don’t define initialize def initialize(config) end
9 10 11 12 13 |
# File 'lib/glia/cell.rb', line 9 def children @children ||= {} child_definitions.keys.each{|p| @children[p] ||= cell(p)} unless child_definitions.nil? @children end |
#themes ⇒ Object
30 31 32 |
# File 'lib/glia/cell.rb', line 30 def themes layout.themes end |