Class: Class

Inherits:
Object
  • Object
show all
Defined in:
lib/git_workflow/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#delegates_to_class(method) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'lib/git_workflow/core_ext.rb', line 2

def delegates_to_class(method)
  class_eval do
    linenumber = __LINE__ + 1
    eval(%Q{
      def #{ method }(*args, &block)
        self.class.#{ method }(*args, &block)
      end
    }, binding, __FILE__, linenumber)
  end
end