Created
November 24, 2012 23:49
-
-
Save bigthyme/4141839 to your computer and use it in GitHub Desktop.
pt.3
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
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