Class: Foundation::Grid
- Inherits:
-
Object
- Object
- Foundation::Grid
- Defined in:
- lib/foundation_helper.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ Grid
constructor
A new instance of Grid.
- #row(*args, &block) ⇒ Object
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(&block) ⇒ Grid
Returns a new instance of Grid.
92 93 94 95 |
# File 'lib/foundation_helper.rb', line 92 def initialize(&block) @rows = [] instance_exec(&block) if block end |
Instance Method Details
#row(*args, &block) ⇒ Object
97 98 99 |
# File 'lib/foundation_helper.rb', line 97 def row(*args, &block) @rows << Row.new(*args, &block) end |
#to_s ⇒ Object Also known as: to_str
101 102 103 104 105 106 107 108 |
# File 'lib/foundation_helper.rb', line 101 def to_s g = "" @rows.each do |r| g += r.render end g end |