Class: Sinatra::Helpers::HamlErrorPresenter

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

Overview

Instance Method Summary collapse

Instance Method Details

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



5
6
7
8
9
# File 'lib/sinatra/helpers/haml_error_presenter.rb', line 5

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

#present(context) ⇒ Object



11
12
13
14
# File 'lib/sinatra/helpers/haml_error_presenter.rb', line 11

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