lib/apiculture/action.rb in apiculture-0.0.19 vs lib/apiculture/action.rb in apiculture-0.1.0

- old
+ new

@@ -9,12 +9,12 @@ # The main work method is +perform+ which should return a data structure that can be converted # into JSON by the caller. class Apiculture::Action # Initialize a new BasicAction, with the given Sintra application and a hash # of keyword arguments that will be converted into instance variables. - def initialize(sinatra_app, **ivars) + def initialize(app_receiver, **ivars) ivars.each_pair {|k,v| instance_variable_set("@#{k}", v) } - @_sinatra_app = sinatra_app + @_sinatra_app = app_receiver end # Halt with a JSON error message (delegates to Sinatra's halt() under the hood) def bail(with_error_message, status: 400, **attrs_for_json_response) @_sinatra_app.json_halt(with_error_message, status: status, **attrs_for_json_response)