Module: Glia::Cell

Defined in:
lib/glia/cell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blocksObject

Returns the value of attribute blocks.



3
4
5
# File 'lib/glia/cell.rb', line 3

def blocks
  @blocks
end

#child_definitionsObject

Returns the value of attribute child_definitions.



3
4
5
# File 'lib/glia/cell.rb', line 3

def child_definitions
  @child_definitions
end

#layoutObject

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

#childrenObject

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

#themesObject



30
31
32
# File 'lib/glia/cell.rb', line 30

def themes
  layout.themes
end