Class: Appfuel::Request
- Inherits:
-
Object
- Object
- Appfuel::Request
- Defined in:
- lib/appfuel/request.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#action_route ⇒ Object
readonly
Returns the value of attribute action_route.
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#inputs ⇒ Object
readonly
Returns the value of attribute inputs.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
Instance Method Summary collapse
-
#initialize(action_route, inputs = {}) ⇒ Request
constructor
A new instance of Request.
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
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/appfuel/request.rb', line 3 def action @action end |
#action_route ⇒ Object (readonly)
Returns the value of attribute action_route.
3 4 5 |
# File 'lib/appfuel/request.rb', line 3 def action_route @action_route end |
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
3 4 5 |
# File 'lib/appfuel/request.rb', line 3 def feature @feature end |
#inputs ⇒ Object (readonly)
Returns the value of attribute inputs.
3 4 5 |
# File 'lib/appfuel/request.rb', line 3 def inputs @inputs end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
3 4 5 |
# File 'lib/appfuel/request.rb', line 3 def namespace @namespace end |