Class: Kamisaku::HtmlBuilder

Inherits:
Object
  • Object
show all
Includes:
TemplateHelpers
Defined in:
lib/kamisaku/html_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TemplateHelpers

#month_name

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