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.



71
72
73
74
# File 'lib/foundation_helper.rb', line 71

def initialize(&block)
  @rows = []
  instance_exec(&block) if block
end

Instance Method Details

#row(max = 12, &block) ⇒ Object



76
77
78
# File 'lib/foundation_helper.rb', line 76

def row(max=12, &block)
  @rows << Row.new(max, &block)
end

#to_sObject Also known as: to_str



80
81
82
83
84
85
86
87
# File 'lib/foundation_helper.rb', line 80

def to_s
  g = ""
  @rows.each do |r|
    g += r.render
  end

  g
end