Class: Twat::Subcommands::Track

Inherits:
Base
  • Object
show all
Includes:
FollowMixin
Defined in:
lib/twat/subcommands/track.rb

Constant Summary

Constants included from FollowMixin

FollowMixin::POLLING_RESOLUTION

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FollowMixin

#run, #untested

Methods inherited from Base

#args, #beep, #deentitize, #enable_readline!, #format, #initialize, #needs_arguments, #needs_at_least, #opts, #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



23
24
25
# File 'lib/twat/subcommands/track.rb', line 23

def self.usage
  ["Usage: twat track username"]
end

Instance Method Details

#auth!Object

TODO configless mixin



7
8
# File 'lib/twat/subcommands/track.rb', line 7

def auth! # Disable authentication
end

#configObject

Stub out a config object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/twat/subcommands/track.rb', line 10

def config # Stub out a config object
  @_config ||= if (c = super).exists?
                 c
               else
                 OpenStruct.new({
                   :polling_interval => 60,
                   :colors? => true,
                   :beep? => false,
                   :account_name => "IMPOSSIBLEUSERNAME!"
                 })
               end
end

#new_tweets(opts) ⇒ Object



27
28
29
# File 'lib/twat/subcommands/track.rb', line 27

def new_tweets(opts)
  Twitter.user_timeline(@argv[0], opts)
end