Advertisement
Guest User

Untitled

a guest
Mar 30th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # this is in notifier.rb
  2. module Notifier
  3.   def print_done(msg);  puts "[+] #{msg}"; end
  4.   def print_note(msg);  puts "[!] #{msg}"; end
  5.   def print_error(msg); puts "[-] #{msg}"; end
  6. end
  7.  
  8. # this is in where_i_wanna_use_this_notifier.rb
  9. require 'notifier'
  10. class WhereIWannaUseThisNotifier
  11.   include Notifier
  12.  
  13.   def some_method
  14.     if do_the_thing
  15.       print_done "This thing was completed now."
  16.     else
  17.       print_error "ZOMG! It returned false!"
  18.     end
  19.   end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement