Class: Twitter::Streaming::Event
- Inherits:
-
Object
- Object
- Twitter::Streaming::Event
- Defined in:
- lib/twitter/streaming/event.rb
Overview
Represents a streaming event from the Twitter API
Constant Summary collapse
- LIST_EVENTS =
Event names for list-related events
i[ 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 ].freeze
- TWEET_EVENTS =
Event names for tweet-related events
i[ favorite unfavorite quoted_tweet ].freeze
Instance Attribute Summary collapse
-
#name ⇒ Twitter::Tweet, ...
readonly
Returns the target object.
-
#source ⇒ Twitter::Tweet, ...
readonly
Returns the target object.
-
#target ⇒ Twitter::Tweet, ...
readonly
Returns the target object.
-
#target_object ⇒ Twitter::Tweet, ...
readonly
Returns the target object.
Instance Method Summary collapse
-
#initialize(data) ⇒ Twitter::Streaming::Event
constructor
Initializes a new Event object.
Constructor Details
#initialize(data) ⇒ Twitter::Streaming::Event
Initializes a new Event object
55 56 57 58 59 60 |
# File 'lib/twitter/streaming/event.rb', line 55 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
#name ⇒ Twitter::Tweet, ... (readonly)
Returns the target object
46 47 48 |
# File 'lib/twitter/streaming/event.rb', line 46 def name @name end |
#source ⇒ Twitter::Tweet, ... (readonly)
Returns the target object
46 47 48 |
# File 'lib/twitter/streaming/event.rb', line 46 def source @source end |
#target ⇒ Twitter::Tweet, ... (readonly)
Returns the target object
46 47 48 |
# File 'lib/twitter/streaming/event.rb', line 46 def target @target end |
#target_object ⇒ Twitter::Tweet, ... (readonly)
Returns the target object
46 47 48 |
# File 'lib/twitter/streaming/event.rb', line 46 def target_object @target_object end |