Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/util.rb,
lib/metaid.rb
Instance Method Summary collapse
- #args_and_options(*args) ⇒ Object
-
#class_def(name, &blk) ⇒ Object
Defines an instance method within a class.
-
#meta_def(name, &blk) ⇒ Object
Adds methods to a metaclass.
- #meta_eval(*args, &blk) ⇒ Object
-
#metaclass ⇒ Object
The hidden singleton lurks behind everyone.
Instance Method Details
#args_and_options(*args) ⇒ Object
2 3 4 5 |
# File 'lib/util.rb', line 2 def (*args) = Hash === args.last ? args.pop : {} return args, end |
#class_def(name, &blk) ⇒ Object
Defines an instance method within a class
14 15 16 |
# File 'lib/metaid.rb', line 14 def class_def name, &blk class_eval { define_method name, &blk } end |
#meta_def(name, &blk) ⇒ Object
Adds methods to a metaclass
9 10 11 |
# File 'lib/metaid.rb', line 9 def name, &blk { define_method name, &blk } end |
#meta_eval(*args, &blk) ⇒ Object
5 |
# File 'lib/metaid.rb', line 5 def (*args, &blk); .instance_eval(*args, &blk); end |
#metaclass ⇒ Object
The hidden singleton lurks behind everyone
3 |
# File 'lib/metaid.rb', line 3 def ; class << self; self; end; end |