Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- #Let's start with a Sexy Class!
- class Selector
- #Our "constructor"
- def initialize(lang)
- @lang = lang
- end
- #Our magic function
- def better?
- if @lang.downcase == "ruby"
- puts "You just choosed the best language! Congrats!\n"
- else
- puts "Ruby is better than #{@lang}!\n"
- end
- end
- end
- #Now we create a sexy object
- perl = Selector.new("Perl")
- #Let's ask the magic class what's the better language
- perl.better?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement