Class: Appfuel::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/appfuel/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action_route, inputs = {}) ⇒ Request

Returns a new instance of Request.



5
6
7
8
9
10
11
12
# File 'lib/appfuel/request.rb', line 5

def initialize(action_route, inputs = {})
  unless inputs.respond_to?(:to_h)
    fail "inputs must respond to :to_h"
  end
  @inputs = inputs.to_h
  @action_route, @feature, @action = parse_route(action_route)
  @namespace = "features.#{feature}.actions.#{action}"
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



3
4
5
# File 'lib/appfuel/request.rb', line 3

def action
  @action
end

#action_routeObject (readonly)

Returns the value of attribute action_route.



3
4
5
# File 'lib/appfuel/request.rb', line 3

def action_route
  @action_route
end

#featureObject (readonly)

Returns the value of attribute feature.



3
4
5
# File 'lib/appfuel/request.rb', line 3

def feature
  @feature
end

#inputsObject (readonly)

Returns the value of attribute inputs.



3
4
5
# File 'lib/appfuel/request.rb', line 3

def inputs
  @inputs
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



3
4
5
# File 'lib/appfuel/request.rb', line 3

def namespace
  @namespace
end