Class: Foundation::Grid

Inherits:
Object
  • Object
show all
Defined in:
lib/foundation_helper.rb

Instance Method Summary collapse

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_sObject 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