Class: Object

Inherits:
BasicObject
Defined in:
lib/rbcurse/rwidget.rb

Instance Method Summary collapse

Instance Method Details

#yield_or_eval(&block) ⇒ Object

thanks to terminal-table for this method



52
53
54
55
56
57
58
59
# File 'lib/rbcurse/rwidget.rb', line 52

def yield_or_eval &block
  return unless block
  if block.arity > 0 
    yield self
  else
    self.instance_eval(&block)
  end 
end