Class: Linecook::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/linecook/proxy.rb

Overview

A proxy used to chain method calls back to a recipe.

Instance Method Summary collapse

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_sObject

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