Class: Pwl::Presenter::Html

Inherits:
Object
  • Object
show all
Defined in:
lib/pwl/presenter/html.rb

Constant Summary collapse

DEFAULT_EXPORT_TEMPLATE =
File.join(File.dirname(__FILE__), *%w[.. .. .. templates export.html.erb])

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locker) ⇒ Html

Returns a new instance of Html.



9
10
11
12
# File 'lib/pwl/presenter/html.rb', line 9

def initialize(locker)
    @locker = locker
    @template = ERB.new(File.read(DEFAULT_EXPORT_TEMPLATE))
end

Instance Attribute Details

#lockerObject (readonly)

used by the ERB template



6
7
8
# File 'lib/pwl/presenter/html.rb', line 6

def locker
  @locker
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/pwl/presenter/html.rb', line 14

def to_s
  @template.result(binding)
end