Module: ForwardTo
- Defined in:
- lib/shellopts/ext/forward_to.rb
Instance Method Summary collapse
Instance Method Details
#forward_self_to(target, *methods) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/shellopts/ext/forward_to.rb', line 5 def forward_self_to(target, *methods) for method in Array(methods).flatten if method =~ /=$/ class_eval("def self.#{method}(*args) #{target}.#{method}(*args) end") else class_eval("def self.#{method}(*args, &block) #{target}.#{method}(*args, &block) end") end end end |