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.



11
12
13
14
15
# File 'lib/onebox/view.rb', line 11

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.



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

def record
  @record
end

Instance Method Details

#to_htmlObject



17
18
19
# File 'lib/onebox/view.rb', line 17

def to_html
  render(record)
end