Class: Layout::Block::Cell
- Inherits:
-
Cell
- Object
- Cell
- Layout::Block::Cell
- Defined in:
- app/cells/lato_view/layout/block/cell.rb
Constant Summary collapse
- @@widths =
VIEW_GRIDCLASS
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#custom_class ⇒ Object
Returns the value of attribute custom_class.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#close ⇒ Object
close block.
-
#initialize(width: 'small-12 medium-12 large-12 xlarge-12', content: '', custom_class: '') ⇒ Cell
constructor
A new instance of Cell.
-
#open(width: @width, custom_class: @class) ⇒ Object
open new block.
- #show ⇒ Object
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
#content ⇒ Object
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_class ⇒ Object
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 |
#width ⇒ Object
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
#close ⇒ Object
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 |
#show ⇒ Object
17 18 19 |
# File 'app/cells/lato_view/layout/block/cell.rb', line 17 def show open + @content + close end |