Module: Blot::Helpers::Grid

Included in:
Blot::Helpers
Defined in:
lib/blot/helpers/grid.rb

Instance Method Summary collapse

Instance Method Details

#columns(width, options = {}, &block) ⇒ Object Also known as: column



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/blot/helpers/grid.rb', line 32

def columns(width, options={}, &block)
   :table, class: "#{width} columns" do
     :tr do
       :td, options do
        if block_given?

          options[:class] == 'center' ? (:center, yield) : yield

        end
      end
       :td, class: 'expander'
    end
  end
end

#container(options = {}, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/blot/helpers/grid.rb', line 4

def container(options={}, &block)
   :table, class: 'container' do
     :tr do
       :td, options do
        options[:class] == 'center' ? (:center, yield) : yield
      end
    end
  end
end

#row(&block) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/blot/helpers/grid.rb', line 14

def row(&block)
   :table, class: 'row' do
     :tr do
      yield if block_given?
    end
  end
end

#wrapper(options = {}, &block) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/blot/helpers/grid.rb', line 22

def wrapper(options={}, &block)
   :td, options do
    if block_given?

      options[:class] == 'center' ? (:center, yield) : yield

    end
  end
end