Class: Twitter::Streaming::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter/streaming/event.rb

Constant Summary

LIST_EVENTS =
[
  :list_created, :list_destroyed, :list_updated, :list_member_added,
  :list_member_added, :list_member_removed, :list_user_subscribed,
  :list_user_subscribed, :list_user_unsubscribed, :list_user_unsubscribed,
]
TWEET_EVENTS =
[
  :favorite, :unfavorite,
]

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Event) initialize(data)



17
18
19
20
21
22
# File 'lib/twitter/streaming/event.rb', line 17

def initialize(data)
  @name = data[:event].to_sym
  @source = Twitter::User.new(data[:source])
  @target = Twitter::User.new(data[:target])
  @target_object = target_object_factory(@name, data[:target_object])
end

Instance Attribute Details

- (Object) name (readonly)

Returns the value of attribute name



14
15
16
# File 'lib/twitter/streaming/event.rb', line 14

def name
  @name
end

- (Object) source (readonly)

Returns the value of attribute source



14
15
16
# File 'lib/twitter/streaming/event.rb', line 14

def source
  @source
end

- (Object) target (readonly)

Returns the value of attribute target



14
15
16
# File 'lib/twitter/streaming/event.rb', line 14

def target
  @target
end

- (Object) target_object (readonly)

Returns the value of attribute target_object



14
15
16
# File 'lib/twitter/streaming/event.rb', line 14

def target_object
  @target_object
end