Class: Sinatra::OhmErrorHelpers::HamlErrorPresenter

Inherits:
Ohm::Validations::Presenter
  • Object
show all
Defined in:
lib/sinatra/support/ohmerrorhelpers.rb

Overview

Instance Method Summary collapse

Instance Method Details

#on(error, message = (block_given? ? @context.capture_haml { yield } : raise(ArgumentError))) ⇒ Object



64
65
66
67
68
# File 'lib/sinatra/support/ohmerrorhelpers.rb', line 64

def on(error, message = (block_given? ? @context.capture_haml { yield } : raise(ArgumentError)))
  handle(error) do
    @output << message
  end
end

#present(context) ⇒ Object



70
71
72
73
# File 'lib/sinatra/support/ohmerrorhelpers.rb', line 70

def present(context)
  @context = context
  super()
end