Created
August 19, 2012 23:17
-
-
Save seanredmond/3398453 to your computer and use it in GitHub Desktop.
Trivial Ruby object example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
class Greetings | |
def greet(recipient = "World") | |
puts "Hello, #{recipient}" | |
end | |
end | |
g = Greetings.new | |
if ARGV.count < 1 | |
g.greet() | |
else | |
g.greet(ARGV.first) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment