| Module | CoreEx::Proc |
| In: |
lib/core_ex/proc.rb
|
# File lib/core_ex/proc.rb, line 41 def instance_call ( anObject, *args, &block ) argc = args.size case arity when 1 + argc call(anObject, *args, &block) when argc, -1 raise ArgumentError, "No block needed" if block anObject.instance_eval_with_args(*args, &self) else if arity < 0 and argc >= arity.abs - 2 call(anObject, *args, &block) else raise ArityError end end end
# File lib/core_ex/proc.rb, line 25 def source_line to_s[/#<#{self.class}:.*@.*:(\d*)>/, 1].to_i end