Class: Voom::Presenters::DSL::Components::Mixins::LastResponse::ActionParameter
- Inherits:
-
Object
- Object
- Voom::Presenters::DSL::Components::Mixins::LastResponse::ActionParameter
- Includes:
- Serializer
- Defined in:
- lib/voom/presenters/dsl/components/mixins/last_response.rb
Overview
Defines a client side dynamic parameter used by an action Example usage:
updates forte_path, params: params
updates update_portal_path(portal_id: portal.id, token: last_response.token)
Instance Attribute Summary collapse
-
#response_index ⇒ Object
readonly
Returns the value of attribute response_index.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #dynamic_parameter ⇒ Object
-
#initialize(index = 0) ⇒ ActionParameter
constructor
A new instance of ActionParameter.
- #method_missing(name, *args, &block) ⇒ Object
- #to_h ⇒ Object
Methods included from Serializer
Constructor Details
#initialize(index = 0) ⇒ ActionParameter
Returns a new instance of ActionParameter.
16 17 18 19 20 |
# File 'lib/voom/presenters/dsl/components/mixins/last_response.rb', line 16 def initialize(index=0) @value = [] @type = :action_parameter @response_index = index end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
30 31 32 33 |
# File 'lib/voom/presenters/dsl/components/mixins/last_response.rb', line 30 def method_missing(name, *args, &block) @value << name self end |
Instance Attribute Details
#response_index ⇒ Object (readonly)
Returns the value of attribute response_index.
14 15 16 |
# File 'lib/voom/presenters/dsl/components/mixins/last_response.rb', line 14 def response_index @response_index end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
14 15 16 |
# File 'lib/voom/presenters/dsl/components/mixins/last_response.rb', line 14 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
14 15 16 |
# File 'lib/voom/presenters/dsl/components/mixins/last_response.rb', line 14 def value @value end |
Instance Method Details
#dynamic_parameter ⇒ Object
22 23 24 |
# File 'lib/voom/presenters/dsl/components/mixins/last_response.rb', line 22 def dynamic_parameter true end |
#to_h ⇒ Object
35 36 37 |
# File 'lib/voom/presenters/dsl/components/mixins/last_response.rb', line 35 def to_h to_hash(false) end |