Class: Linecook::Proxy
- Inherits:
-
Object
- Object
- Linecook::Proxy
- Defined in:
- lib/linecook/proxy.rb
Overview
A proxy used to chain method calls back to a recipe.
Instance Method Summary collapse
-
#initialize(recipe) ⇒ Proxy
constructor
A new instance of Proxy.
-
#method_missing(*args, &block) ⇒ Object
Proxies to recipe.chain.
-
#to_s ⇒ Object
Returns an empty string, such that the proxy makes no text when it is accidentally put into a target by a helper.
Constructor Details
#initialize(recipe) ⇒ Proxy
Returns a new instance of Proxy.
4 5 6 |
# File 'lib/linecook/proxy.rb', line 4 def initialize(recipe) @recipe = recipe end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object
Proxies to recipe.chain.
9 10 11 |
# File 'lib/linecook/proxy.rb', line 9 def method_missing(*args, &block) @recipe.chain(*args, &block) end |
Instance Method Details
#to_s ⇒ Object
Returns an empty string, such that the proxy makes no text when it is accidentally put into a target by a helper.
15 16 17 |
# File 'lib/linecook/proxy.rb', line 15 def to_s '' end |