Module: Kernel

Defined in:
lib/twitter/core_ext/kernel.rb

Instance Method Summary collapse

Instance Method Details

#calling_methodObject



3
4
5
# File 'lib/twitter/core_ext/kernel.rb', line 3

def calling_method
  caller[1][/`([^']*)'/, 1].to_sym
end

#class_eval(*args, &block) ⇒ Object

class_eval on an object acts like singleton_class.class_eval.



11
12
13
# File 'lib/twitter/core_ext/kernel.rb', line 11

def class_eval(*args, &block)
  singleton_class.class_eval(*args, &block)
end

#singleton_classObject

Returns the object’s singleton class (exists in Ruby 1.9.2)



8
# File 'lib/twitter/core_ext/kernel.rb', line 8

def singleton_class; class << self; self; end; end