Class: Object

Inherits:
BasicObject
Defined in:
lib/ext.rb

Instance Method Summary collapse

Instance Method Details

#error(s) ⇒ Object



33
# File 'lib/ext.rb', line 33

def error(s) $stderr.puts s end

#error!(s) ⇒ Object

Raises:

  • (Exception)


34
# File 'lib/ext.rb', line 34

def error!(s) raise Exception, s end

#log(s = '') ⇒ Object



31
# File 'lib/ext.rb', line 31

def log(s = '')  puts "* #{s}" if $verbose end

#log!(s = '') ⇒ Object



32
# File 'lib/ext.rb', line 32

def log!(s = '') puts "* #{s}" end

#tap {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Object)

    the object that the method was called on



26
27
28
29
# File 'lib/ext.rb', line 26

def tap
  yield self
  self
end

#verboseObject



19
20
21
22
23
24
# File 'lib/ext.rb', line 19

def verbose
  $verbose = true
  yield
ensure
  $verbose = false
end