Module: Kernel
- Defined in:
- lib/ruby_is.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/ruby_is.rb', line 59
def method_missing(name, *args, &block)
if (args.count == 1) and args.first.is_a?(Hash) and args.first.has_key?(:__is__method_body)
define_method name, args.first[:__is__method_body]
if TOPLEVEL_BINDING.eval('self') == self
private name
end
else
super
end
end
|
Instance Method Details
#is(*args, &block) ⇒ Object
Also known as:
are
53
54
55
|
# File 'lib/ruby_is.rb', line 53
def is(*args, &block);
{ __is__method_body: RubyIs.proc_or_block(args, block) }
end
|