Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/charlie/etc/monkey.rb

Instance Method Summary collapse

Instance Method Details

#metaclassObject



119
120
121
# File 'lib/charlie/etc/monkey.rb', line 119

def metaclass
  class << self;self;end
end

#name=(n) ⇒ Object

Used to give anonymous modules a name.



124
125
126
# File 'lib/charlie/etc/monkey.rb', line 124

def name=(n)
  metaclass.class_eval{ define_method(:to_s){ n } } # avoid send for ruby 1.9
end