foundation-helper 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/foundation_helper.rb +7 -7
  2. metadata +2 -2
@@ -4,8 +4,8 @@ module Foundation
4
4
 
5
5
  class Row
6
6
 
7
- def initialize(max=12, &block)
8
- @max, @content = max, []
7
+ def initialize(*args, &block)
8
+ @content, @classes, @max = [], args.select { |arg| !arg.is_a? Fixnum }, (args.find{ |arg| arg.is_a? Fixnum } || 12)
9
9
  if block
10
10
  content = instance_exec(self, &block)
11
11
  @content << content if content != self
@@ -29,7 +29,7 @@ module Foundation
29
29
  width = [(remaining / unsized), 1].max unless unsized.z0?
30
30
 
31
31
  out = " " * depth
32
- out += "<div class='row'>\n"
32
+ out += "<div class='#{[:row, *@classes].join(' ')}'>\n"
33
33
  @content.each do |content|
34
34
  if content.is_a? Foundation::Column
35
35
  out += content.render(depth + 1, width)
@@ -59,8 +59,8 @@ module Foundation
59
59
  end
60
60
  end
61
61
 
62
- def row(max=12, &block)
63
- @content << Row.new(max, &block)
62
+ def row(*args, &block)
63
+ @content << Row.new(*args, &block)
64
64
  self
65
65
  end
66
66
 
@@ -94,8 +94,8 @@ module Foundation
94
94
  instance_exec(&block) if block
95
95
  end
96
96
 
97
- def row(max=12, &block)
98
- @rows << Row.new(max, &block)
97
+ def row(*args, &block)
98
+ @rows << Row.new(*args, &block)
99
99
  end
100
100
 
101
101
  def to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foundation-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-03 00:00:00.000000000 Z
12
+ date: 2013-06-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mobj