Class: Caisson::Helpers::Grid
- Inherits:
-
Object
- Object
- Caisson::Helpers::Grid
- Defined in:
- lib/caisson/helpers/grid.rb
Instance Attribute Summary collapse
-
#core ⇒ Object
readonly
Returns the value of attribute core.
Instance Method Summary collapse
- #column(span, options = {}, &block) ⇒ Object
-
#initialize(core) ⇒ Grid
constructor
A new instance of Grid.
- #row(options = {}, &block) ⇒ Object
Constructor Details
#initialize(core) ⇒ Grid
Returns a new instance of Grid.
8 9 10 |
# File 'lib/caisson/helpers/grid.rb', line 8 def initialize(core) @core = core end |
Instance Attribute Details
#core ⇒ Object (readonly)
Returns the value of attribute core.
3 4 5 |
# File 'lib/caisson/helpers/grid.rb', line 3 def core @core end |
Instance Method Details
#column(span, options = {}, &block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/caisson/helpers/grid.rb', line 12 def column(span, ={}, &block) .reverse_merge! class: nil, id: nil, small: nil, tag: :div css_class = ['columns'] css_class << "large-#{span}" css_class << "small-#{options[:small]}" if [:small] css_class << [:class] if [:class] content_tag([:tag], capture(&block), class: css_class.join(' '), id: [:id]) end |
#row(options = {}, &block) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/caisson/helpers/grid.rb', line 23 def row(={}, &block) .reverse_merge! class: nil, id: nil, tag: :div css_class = ['row'] css_class << [:class] if [:class] content_tag([:tag], capture(&block), class: css_class.join(' '), id: [:id]) end |