Class: Kamisaku::HtmlBuilder
- Inherits:
-
Object
- Object
- Kamisaku::HtmlBuilder
- Includes:
- TemplateHelpers
- Defined in:
- lib/kamisaku/html_builder.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#content_hash ⇒ Object
(also: #data)
readonly
Returns the value of attribute content_hash.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(content_hash, category, template) ⇒ HtmlBuilder
constructor
A new instance of HtmlBuilder.
Methods included from TemplateHelpers
Constructor Details
#initialize(content_hash, category, template) ⇒ HtmlBuilder
Returns a new instance of HtmlBuilder.
10 11 12 13 14 |
# File 'lib/kamisaku/html_builder.rb', line 10 def initialize(content_hash, category, template) @content_hash = content_hash @category = category @template = template end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
5 6 7 |
# File 'lib/kamisaku/html_builder.rb', line 5 def category @category end |
#content_hash ⇒ Object (readonly) Also known as: data
Returns the value of attribute content_hash.
5 6 7 |
# File 'lib/kamisaku/html_builder.rb', line 5 def content_hash @content_hash end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
5 6 7 |
# File 'lib/kamisaku/html_builder.rb', line 5 def template @template end |
Instance Method Details
#html ⇒ Object
16 17 18 19 |
# File 'lib/kamisaku/html_builder.rb', line 16 def html rhtml = ::ERB.new(template_html) rhtml.result(binding) end |