Skip to content

Instantly share code, notes, and snippets.

@bigthyme
Created November 24, 2012 23:49
Show Gist options
  • Save bigthyme/4141839 to your computer and use it in GitHub Desktop.
Save bigthyme/4141839 to your computer and use it in GitHub Desktop.
pt.3
def run
puts "Welcome to the Command Line Twitter Client"
command = ""
#[6]use cases, if a user types button "x" do something, if a user types button "y" do something.
while command != "q"
printf "enter command: "
input = gets.chomp
parts = input.split
command = parts[0]
case command
when 'q' then puts "Goodbye!"
when 't' then tweet(parts[1..-1].join(" "))
else
puts "I'm sorry, I don't know how to #{command}"
end
end
end
end
#[7]Instantiates a new object and assigns it to a variable "jst"
jst = JSTwitter.new
jst.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment