Class: Layout::Step::Cell
- Inherits:
-
Cell
- Object
- Cell
- Layout::Step::Cell
- Defined in:
- app/cells/lato_view/layout/step/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.
-
#next_name ⇒ Object
Returns the value of attribute next_name.
-
#prev_name ⇒ Object
Returns the value of attribute prev_name.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#close(prev_name: @prev_name, next_name: @next_name) ⇒ Object
close step container.
- #close_step ⇒ Object
-
#initialize(width: 'small-12 medium-12 large-12 xlarge-12', content: '', custom_class: '', prev_name: 'Prev', next_name: 'Next') ⇒ Cell
constructor
A new instance of Cell.
-
#open(width: @width, custom_class: @class) ⇒ Object
open new step container.
- #open_step(active: false) ⇒ Object
- #show ⇒ Object
Constructor Details
#initialize(width: 'small-12 medium-12 large-12 xlarge-12', content: '', custom_class: '', prev_name: 'Prev', next_name: 'Next') ⇒ Cell
Returns a new instance of Cell.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/cells/lato_view/layout/step/cell.rb', line 8 def initialize(width: 'small-12 medium-12 large-12 xlarge-12', content: '', custom_class: '', prev_name: 'Prev', next_name: 'Next') # save params @width = width @content = content @class = custom_class @random = SecureRandom.hex @prev_name = prev_name @next_name = next_name # check params end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
6 7 8 |
# File 'app/cells/lato_view/layout/step/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/step/cell.rb', line 6 def custom_class @custom_class end |
#next_name ⇒ Object
Returns the value of attribute next_name.
6 7 8 |
# File 'app/cells/lato_view/layout/step/cell.rb', line 6 def next_name @next_name end |
#prev_name ⇒ Object
Returns the value of attribute prev_name.
6 7 8 |
# File 'app/cells/lato_view/layout/step/cell.rb', line 6 def prev_name @prev_name end |
#width ⇒ Object
Returns the value of attribute width.
6 7 8 |
# File 'app/cells/lato_view/layout/step/cell.rb', line 6 def width @width end |
Instance Method Details
#close(prev_name: @prev_name, next_name: @next_name) ⇒ Object
close step container
40 41 42 |
# File 'app/cells/lato_view/layout/step/cell.rb', line 40 def close(prev_name: @prev_name, next_name: @next_name) "</div><div class='step-navigator' data-step-id='#{@random}'><button class='lato-button step-button step-prev'>#{prev_name}</button><div class='step-paginate-container'><ul class='step-paginate'></ul></div><button class='lato-button step-button step-next'>#{next_name}</button></div></div></div>" end |
#close_step ⇒ Object
35 36 37 |
# File 'app/cells/lato_view/layout/step/cell.rb', line 35 def close_step "</div>" end |
#open(width: @width, custom_class: @class) ⇒ Object
open new step container
25 26 27 28 |
# File 'app/cells/lato_view/layout/step/cell.rb', line 25 def open(width: @width, custom_class: @class) "<div class='content-block column #{width} #{custom_class}'><div class='element-step' data-step-id='#{@random}'> <div class='step-scroller'>" end |
#open_step(active: false) ⇒ Object
30 31 32 33 |
# File 'app/cells/lato_view/layout/step/cell.rb', line 30 def open_step(active: false) "<div class='step'>" if active "<div class='step active'>" end |
#show ⇒ Object
20 21 22 |
# File 'app/cells/lato_view/layout/step/cell.rb', line 20 def show open + @content + close end |