Class: Object
- Inherits:
- BasicObject
- Includes:
- NamedParameters
- Defined in:
- lib/named-parameters.rb,
lib/named-parameters/object.rb
Overview
metaclass helpers from _why…
See: www.ruby-forum.com/topic/77046 See: github.com/dannytatom/metaid See: dannytatom.github.com/metaid/
Instance Method Summary collapse
-
#class_def(name, &block) ⇒ Object
defines an instance method within a class.
-
#meta_def(name, &block) ⇒ Object
adds methods to a metaclass.
- #meta_eval(&block) ⇒ Object
-
#metaclass ⇒ Object
:nodoc:.
Methods included from NamedParameters
#declared_parameters, #declared_parameters_for, #filter_parameters
Instance Method Details
#class_def(name, &block) ⇒ Object
defines an instance method within a class
23 24 25 |
# File 'lib/named-parameters/object.rb', line 23 def class_def name, &block class_eval { define_method name, &block } end |
#meta_def(name, &block) ⇒ Object
adds methods to a metaclass
18 19 20 |
# File 'lib/named-parameters/object.rb', line 18 def name, &block { define_method name, &block } end |
#meta_eval(&block) ⇒ Object
13 14 15 |
# File 'lib/named-parameters/object.rb', line 13 def &block .instance_eval(&block) end |
#metaclass ⇒ Object
:nodoc:
9 10 11 |
# File 'lib/named-parameters/object.rb', line 9 def # :nodoc: class << self; self; end end |