Class: Twitter4j4r::Listener

Inherits:
Object
  • Object
show all
Includes:
Java::Twitter4j::StatusListener
Defined in:
lib/twitter4j4r/listener.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, status_block, exception_block, limitation_block) ⇒ Listener

Returns a new instance of Listener.



8
9
10
11
12
13
# File 'lib/twitter4j4r/listener.rb', line 8

def initialize(client, status_block, exception_block, limitation_block)
  @client = client
  @status_block = status_block
  @exception_block = exception_block
  @limitation_block = limitation_block
end

Instance Method Details

#onException(exception) ⇒ Object



19
20
21
# File 'lib/twitter4j4r/listener.rb', line 19

def onException(exception)
  call_block_with_client(@exception_block, exception)
end

#onStatus(status) ⇒ Object



15
16
17
# File 'lib/twitter4j4r/listener.rb', line 15

def onStatus(status)
  call_block_with_client(@status_block, status)
end

#onTrackLimitationNotice(limited_count) ⇒ Object



23
24
25
# File 'lib/twitter4j4r/listener.rb', line 23

def onTrackLimitationNotice(limited_count)
  call_block_with_client(@limitation_block, limited_count)
end