Class: Messed::Interface::Adapter::TwitterConsumer

Inherits:
Messed::Interface::Adapter show all
Defined in:
lib/messed/interface/adapter/twitter_consumer.rb

Direct Known Subclasses

TwitterSearch, TwitterStreaming

Constant Summary

Constants inherited from Messed::Interface::Adapter

Registry

Instance Attribute Summary collapse

Attributes inherited from Messed::Interface::Adapter

#interface

Instance Method Summary collapse

Methods inherited from Messed::Interface::Adapter

for_name, #initialize, #load_state, register_for_name, #save_state, #send, #start, #state_file

Methods included from Logger::LoggingModule

included, #logger, #logger=

Constructor Details

This class inherits a constructor from Messed::Interface::Adapter

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



6
7
8
# File 'lib/messed/interface/adapter/twitter_consumer.rb', line 6

def errors
  @errors
end

#last_errorObject

Returns the value of attribute last_error.



6
7
8
# File 'lib/messed/interface/adapter/twitter_consumer.rb', line 6

def last_error
  @last_error
end

#last_okObject

Returns the value of attribute last_ok.



6
7
8
# File 'lib/messed/interface/adapter/twitter_consumer.rb', line 6

def last_ok
  @last_ok
end

#last_statusObject

Returns the value of attribute last_status.



6
7
8
# File 'lib/messed/interface/adapter/twitter_consumer.rb', line 6

def last_status
  @last_status
end

#packets_processedObject

Returns the value of attribute packets_processed.



6
7
8
# File 'lib/messed/interface/adapter/twitter_consumer.rb', line 6

def packets_processed
  @packets_processed
end

#started_atObject

Returns the value of attribute started_at.



6
7
8
# File 'lib/messed/interface/adapter/twitter_consumer.rb', line 6

def started_at
  @started_at
end

Instance Method Details

#initObject



8
9
10
11
12
13
14
15
# File 'lib/messed/interface/adapter/twitter_consumer.rb', line 8

def init
  @started_at = Time.new
  @packets_processed = 0
  @errors = 0
  @last_error = nil
  @last_ok = nil
  @last_status = nil
end

#statusObject



21
22
23
24
25
26
27
28
29
30
# File 'lib/messed/interface/adapter/twitter_consumer.rb', line 21

def status
  {
    :started_at => started_at,
    :packets_processed => packets_processed,
    :errors => errors,
    :last_error => last_error,
    :last_ok => last_ok,
    :last_status => last_status
  }
end

#typeObject



17
18
19
# File 'lib/messed/interface/adapter/twitter_consumer.rb', line 17

def type
  :twitter
end