Module: Mountapi::Handler::Behaviour

Defined in:
lib/mountapi/handler/behaviour.rb

Overview

The mixin to include in your handler class

You have to define a call instance method that may re-arrange parameters and call you application service.

Given the result of the application service call you choose the response that fit

The call method has access to the params instance attribute reader. It contains the hash with the request parameters

The options variable is also accessible in order to inject dependency for test And for later compatibility

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/mountapi/handler/behaviour.rb', line 20

def self.included(base)
  base.class_eval do
    extend ClassMethods
    include InstanceMethods
    attr_reader :params, :options

    def initialize(params, options = {})
      @params = params
      @options = options
    end
  end
end