Class: Layout::Block::Cell

Inherits:
Cell
  • Object
show all
Defined in:
app/cells/lato_view/layout/block/cell.rb

Constant Summary collapse

@@widths =
VIEW_GRIDCLASS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width: 'small-12 medium-12 large-12 xlarge-12', content: '', custom_class: '') ⇒ Cell

Returns a new instance of Cell.



8
9
10
11
12
13
14
15
# File 'app/cells/lato_view/layout/block/cell.rb', line 8

def initialize(width: 'small-12 medium-12 large-12 xlarge-12', content: '',
               custom_class: '')
  # save params
  @width = width
  @content = content
  @class = custom_class
  # check params
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



6
7
8
# File 'app/cells/lato_view/layout/block/cell.rb', line 6

def content
  @content
end

#custom_classObject

Returns the value of attribute custom_class.



6
7
8
# File 'app/cells/lato_view/layout/block/cell.rb', line 6

def custom_class
  @custom_class
end

#widthObject

Returns the value of attribute width.



6
7
8
# File 'app/cells/lato_view/layout/block/cell.rb', line 6

def width
  @width
end

Instance Method Details

#closeObject

close block



27
28
29
# File 'app/cells/lato_view/layout/block/cell.rb', line 27

def close
  '</div>'
end

#open(width: @width, custom_class: @class) ⇒ Object

open new block



22
23
24
# File 'app/cells/lato_view/layout/block/cell.rb', line 22

def open(width: @width, custom_class: @class)
  "<div class='content-block column #{width} #{custom_class}'>"
end

#showObject



17
18
19
# File 'app/cells/lato_view/layout/block/cell.rb', line 17

def show
  open + @content + close
end