Class: Twat::Subcommands::Finger

Inherits:
Base
  • Object
show all
Defined in:
lib/twat/subcommands/finger.rb

Instance Attribute Summary

Attributes inherited from Base

#opts

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, #pad, #reader, #run!, #usage, #usage_and_exit!

Methods included from Exceptions

#with_handled_exceptions

Constructor Details

This class inherits a constructor from Twat::Subcommands::Base

Class Method Details

.usageObject



17
18
19
# File 'lib/twat/subcommands/finger.rb', line 17

def self.usage
  "Usage: twat finger USERNAME [count]"
end

Instance Method Details

#runObject



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