Module: Minimo::Delegator

Defined in:
lib/minimo.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.targetObject

Returns the value of attribute target.



121
122
123
# File 'lib/minimo.rb', line 121

def target
  @target
end

Class Method Details

.delegate(*methods) ⇒ Object



109
110
111
112
113
114
115
116
# File 'lib/minimo.rb', line 109

def self.delegate(*methods)
  Array(methods).each do |method_name|
    define_method(method_name) do |*args, &block|
      Delegator.target.send(method_name, *args, &block)
    end
    private method_name
  end
end