var/non_existent ! from (irb):41:in `read' def read File.read('/usr/var/non_existent') rescue Errno::ENOENT puts 'hey, file not found' end >> read hey, file not found => nil Friday, March 8, 13
=> "Peter" >> person.whats_my_name NameError: undefined local variable or method `name' for #<Person:0x007feb9613b8c8> ! from (irb):27:in `whats_my_name' ! ... Friday, March 8, 13
log(description) @log << "#{description} - #{Time.now}" yield end def entries @log end end logger = EasyLogger.new %w(sarah bobby jungle stuff).map do |word| logger.log "reverse #{word}" do word.reverse end end Friday, March 8, 13