Class: Onebox::View

Inherits:
Mustache
  • Object
show all
Includes:
TemplateSupport
Defined in:
lib/onebox/view.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TemplateSupport

#load_paths, #template?

Constructor Details

#initialize(name, record) ⇒ View

Returns a new instance of View


9
10
11
12
13
# File 'lib/onebox/view.rb', line 9

def initialize(name, record)
  @record = record
  self.template_name = name
  self.template_path = load_paths.last
end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record


7
8
9
# File 'lib/onebox/view.rb', line 7

def record
  @record
end

Instance Method Details

#to_htmlObject


15
16
17
# File 'lib/onebox/view.rb', line 15

def to_html
  render(record)
end