Exception: ApiHammer::Rails::Halt

Inherits:
StandardError
  • Object
show all
Defined in:
lib/api_hammer/rails/halt.rb

Overview

an exception raised to stop processing an action and render the body given as the 'body' argument (which is expected to be a JSON-able object)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, body, render_options = {}) ⇒ Halt

Returns a new instance of Halt.



13
14
15
16
17
# File 'lib/api_hammer/rails/halt.rb', line 13

def initialize(message, body, render_options={})
  super(message)
  @body = body
  @render_options = render_options
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



19
20
21
# File 'lib/api_hammer/rails/halt.rb', line 19

def body
  @body
end

#render_optionsObject (readonly)

Returns the value of attribute render_options.



19
20
21
# File 'lib/api_hammer/rails/halt.rb', line 19

def render_options
  @render_options
end