Class: Para::Markup::Panel

Inherits:
Component show all
Defined in:
lib/para/markup/panel.rb

Instance Attribute Summary

Attributes inherited from Component

#view

Instance Method Summary collapse

Methods inherited from Component

#initialize

Constructor Details

This class inherits a constructor from Para::Markup::Component

Instance Method Details

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



24
25
26
27
28
29
30
# File 'lib/para/markup/panel.rb', line 24

def body(options = {}, &block)
  merge_class!(options, "panel-body")

  (:div, options) do
    capture { block.call }
  end
end

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



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/para/markup/panel.rb', line 4

def container(options = {}, &block)
  merge_class!(options, "panel")

  if (type = options.fetch(:type, 'default'))
    merge_class!(options, "panel-#{ type }")
  end

  (:div, options) do
    capture { block.call(self) }
  end
end


32
33
34
35
36
37
38
# File 'lib/para/markup/panel.rb', line 32

def footer(options = {}, &block)
  merge_class!(options, "panel-footer")

  (:div, options) do
    capture { block.call }
  end
end

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



16
17
18
19
20
21
22
# File 'lib/para/markup/panel.rb', line 16

def header(options = {}, &block)
  merge_class!(options, "panel-heading")

  (:div, options) do
    capture { block.call }
  end
end