Be nice to Ruby and it will be nice to you.
The best way to introduce politeness into Ruby is to use RubyGems:
$ [sudo] gem install polite
If you're rude to Ruby it will be rude to you:
ruby = .new ruby.get_me_a_coffee # => NoMethodError: undefined method `get_me_a_coffee' for #<Object:0x007fb0421526c0>
But if you're polite, it will be nice to you.
ruby.please.get_me_a_coffee # => nil
However, even Ruby has it's limits:
ruby.please.get_me_a_coffee.and_a_sandwich # => NoMethodError: undefined method `and_a_sandwich' for nil:NilClass
If you want Ruby to do a lot for you, the way to go is to be even more polite:
ruby.pretty_please.get_me_a_coffee # => #<Object:0x007fb0421526c0>
Ruby will definitely be nice to you:
ruby.pretty_please.get_me_a_coffee.and_a_sandwich.and_a_newspaper # => #<Object:0x007fb0421526c0> ruby.pretty_please.respond_to?(:pay_for_my_dinner) # => true
Copyright (c) 2011 Tobias Svensson.
Pick a polite license of your choice.