Class: Object

Inherits:
BasicObject
Includes:
NamedParameters
Defined in:
lib/named-parameters.rb,
lib/named-parameters/object.rb

Overview

Instance Method Summary collapse

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 meta_def name, &block
  meta_eval { define_method name, &block }
end

#meta_eval(&block) ⇒ Object



13
14
15
# File 'lib/named-parameters/object.rb', line 13

def meta_eval &block
  metaclass.instance_eval(&block)
end

#metaclassObject

:nodoc:



9
10
11
# File 'lib/named-parameters/object.rb', line 9

def metaclass # :nodoc:
  class << self; self; end  
end