Module: Ribbon::CoreExtensions::BasicObject
- Defined in:
- lib/ribbon/core_extensions/basic_object.rb
Overview
Some useful methods.
Instance Method Summary collapse
-
#__yield_or_eval__ {|object| ... } ⇒ Object?
Evaluates the block using
instance_eval
if it takes no arguments; yieldsself
to it otherwise.
Instance Method Details
#__yield_or_eval__ {|object| ... } ⇒ Object?
Evaluates the block using instance_eval
if it takes no arguments; yields self
to it otherwise.
15 16 17 |
# File 'lib/ribbon/core_extensions/basic_object.rb', line 15 def __yield_or_eval__(&block) if block.arity.zero? then instance_eval &block else block.call self end if block end |