Class: Focus::ContextualConfiguration
- Inherits:
-
Object
- Object
- Focus::ContextualConfiguration
- Defined in:
- lib/focus/action.rb
Overview
A small wrapper to an Action’s context. If an attribute is defined in the context, it will be returned. Otherwise, a lookup within Focus::Config will take place.
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(context) ⇒ ContextualConfiguration
constructor
A new instance of ContextualConfiguration.
-
#method_missing(m, *args, &block) ⇒ Object
rubocop:disable MethodMissing.
Constructor Details
#initialize(context) ⇒ ContextualConfiguration
Returns a new instance of ContextualConfiguration.
13 14 15 |
# File 'lib/focus/action.rb', line 13 def initialize(context) @context = context end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
rubocop:disable MethodMissing
17 18 19 |
# File 'lib/focus/action.rb', line 17 def method_missing(m, *args, &block) # rubocop:disable MethodMissing context.send(m) || Config.send(m, *args, &block) end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
11 12 13 |
# File 'lib/focus/action.rb', line 11 def context @context end |