Class: Twitter::Streaming::Event
- Inherits:
-
Object
- Object
- Twitter::Streaming::Event
- Defined in:
- lib/twitter/streaming/event.rb
Constant Summary collapse
- LIST_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 =
%i[ favorite unfavorite quoted_tweet ].freeze
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#target_object ⇒ Object
readonly
Returns the value of attribute target_object.
Instance Method Summary collapse
-
#initialize(data) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(data) ⇒ Event
Returns a new instance of Event.
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/twitter/streaming/event.rb', line 14 def name @name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
14 15 16 |
# File 'lib/twitter/streaming/event.rb', line 14 def source @source end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
14 15 16 |
# File 'lib/twitter/streaming/event.rb', line 14 def target @target end |
#target_object ⇒ 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 |