Module: Rios::Easy
- Included in:
- Object
- Defined in:
- lib/rios/easy.rb
Constant Summary collapse
Class Method Summary collapse
-
.delegate(*methods) ⇒ Object
Inspired from Sinatra.
Class Method Details
.delegate(*methods) ⇒ Object
Inspired from Sinatra
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rios/easy.rb', line 8 def self.delegate(*methods) methods.each do |method_name| eval <<-RUBY, binding, '(__DELEGATE__)', 1 def #{method_name}(*args, &block) @@proxy.send(#{method_name.inspect}, *args, &block) end private #{method_name.inspect} RUBY end end |