Class: HaveAPI::Authentication::Token::ActionConfig
- Inherits:
-
Object
- Object
- HaveAPI::Authentication::Token::ActionConfig
- Defined in:
- lib/haveapi/authentication/token/action_config.rb
Instance Method Summary collapse
-
#handle {|request, result| ... } ⇒ Object
Handle the action.
-
#initialize(block, opts = {}) ⇒ ActionConfig
constructor
A new instance of ActionConfig.
-
#input(&block) ⇒ Object
Configure input parameters in the context of Params.
- #update(block) ⇒ Object
Constructor Details
#initialize(block, opts = {}) ⇒ ActionConfig
Returns a new instance of ActionConfig.
8 9 10 11 12 |
# File 'lib/haveapi/authentication/token/action_config.rb', line 8 def initialize(block, opts = {}) @block = block @opts = with_defaults(opts) update(block) end |
Instance Method Details
#handle {|request, result| ... } ⇒ Object
Handle the action
32 33 34 35 36 37 38 |
# File 'lib/haveapi/authentication/token/action_config.rb', line 32 def handle(&block) if block && check!(:handle) @handle = block else @handle end end |
#input(&block) ⇒ Object
Configure input parameters in the context of Params
20 21 22 23 24 25 26 |
# File 'lib/haveapi/authentication/token/action_config.rb', line 20 def input(&block) if block && check!(:input) @input = block else @input end end |
#update(block) ⇒ Object
15 16 17 |
# File 'lib/haveapi/authentication/token/action_config.rb', line 15 def update(block) instance_exec(&block) end |