Class: Twat::Subcommands::Finger
- Defined in:
- lib/twat/subcommands/finger.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
#args, #auth!, #beep, #config, #deentitize, #enable_readline!, #format, #initialize, #needs_arguments, #needs_at_least, #opts, #pad, #reader, #run!, #usage, #usage_and_exit!
Methods included from Exceptions
Constructor Details
This class inherits a constructor from Twat::Subcommands::Base
Class Method Details
.usage ⇒ Object
17 18 19 |
# File 'lib/twat/subcommands/finger.rb', line 17 def self.usage "Usage: twat finger USERNAME [count]" end |
Instance Method Details
#run ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/twat/subcommands/finger.rb', line 4 def run needs_at_least(1) auth! begin Twitter.user_timeline(@argv[0], :count => (@argv[1] || 1).to_i).each do |tweet| puts format(tweet) end # rescue Twitter::NotFound # puts "#{@argv[0].bold.red} doesn't appear to be a valid user" end end |