Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Notifier
- @@prefixes = {
- :done => "[+] ",
- :note => "[!] ",
- :error => "[-] ",
- }
- def self.method_missing(method, *args)
- puts "#{@@prefixes[method]} #{args}"
- end
- end
- # then you do like this all over the place
- Notifier.done "This thing was completed now."
- Notifier.error "ZOMG!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement