Class: Weaver::Row
Overview
Row element
Instance Attribute Summary collapse
-
#extra_classes ⇒ Object
Returns the value of attribute extra_classes.
-
#style ⇒ Object
Returns the value of attribute style.
Instance Method Summary collapse
- #col(occupies, options = {}, &block) ⇒ Object
- #generate ⇒ Object
-
#initialize(page, anchors, options) ⇒ Row
constructor
A new instance of Row.
Methods inherited from Elements
#_button, #accordion, #background, #badge, #big_button, #big_embossed_button, #block_button, #breadcrumb, #center, #circle_button, #crossfade_image, #embossed_button, #gallery, #half, #hyperlink, #ibox, #icon, #image, #jumbotron, #math, #method_missing, #modal, #normal_button, #on_page_load, #outline_button, #p, #panel, #quarter, #request_css, #request_js, #root, #rounded_button, #row, #small_button, #syntax, #table, #table_from_hashes, #table_from_source, #tabs, #text, #third, #tiny_button, #twothirds, #wform, #widget, #write_script_once
Constructor Details
#initialize(page, anchors, options) ⇒ Row
Returns a new instance of Row.
8 9 10 11 12 13 14 15 |
# File 'lib/weaver/element_types/row.rb', line 8 def initialize(page, anchors, ) @columns = [] @free = 12 @extra_classes = [:class] || '' @style = [:style] @anchors = anchors @page = page end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Weaver::Elements
Instance Attribute Details
#extra_classes ⇒ Object
Returns the value of attribute extra_classes.
6 7 8 |
# File 'lib/weaver/element_types/row.rb', line 6 def extra_classes @extra_classes end |
#style ⇒ Object
Returns the value of attribute style.
6 7 8 |
# File 'lib/weaver/element_types/row.rb', line 6 def style @style end |
Instance Method Details
#col(occupies, options = {}, &block) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/weaver/element_types/row.rb', line 17 def col(occupies, = {}, &block) raise 'Not enough columns!' if @free < occupies @columns << Column.new(occupies, @page, @anchors, , &block) @free -= occupies end |
#generate ⇒ Object
24 25 26 |
# File 'lib/weaver/element_types/row.rb', line 24 def generate @columns.map(&:generate).join end |