Exception: Stove::Error::StoveError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/stove/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ StoveError

Returns a new instance of StoveError.



18
19
20
21
22
23
# File 'lib/stove/error.rb', line 18

def initialize(options = {})
  @options  = options
  @filename = options.delete(:_template)

  super()
end

Instance Method Details

#messageObject Also known as: to_s



25
26
27
28
# File 'lib/stove/error.rb', line 25

def message
  erb = ERB.new(File.read(template))
  erb.result(ErrorBinding.new(@options).get_binding)
end