Class: Analytical::Api::ImmediateDelegateHelper
- Inherits:
-
Object
- Object
- Analytical::Api::ImmediateDelegateHelper
- Defined in:
- lib/analytical/api.rb
Overview
Delegation class that passes methods to
Instance Method Summary collapse
-
#initialize(_parent) ⇒ ImmediateDelegateHelper
constructor
A new instance of ImmediateDelegateHelper.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(_parent) ⇒ ImmediateDelegateHelper
Returns a new instance of ImmediateDelegateHelper.
45 46 47 |
# File 'lib/analytical/api.rb', line 45 def initialize(_parent) @parent = _parent end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
48 49 50 51 52 |
# File 'lib/analytical/api.rb', line 48 def method_missing(method, *args, &block) @parent.modules.values.collect do |m| m.send(method, *args) if m.respond_to?(method) end.compact.join("\n") end |