Class: Userstream::DirectMessage

Inherits:
TwitterObject show all
Defined in:
lib/userstream/event/direct_message.rb

Constant Summary collapse

ATTRS =
[:coordinates, :recipient, :sender, :sender_screen_name, :text, :id, :recipient_id, :sender_id]

Constants inherited from TwitterObject

TwitterObject::SINGLE_TWEET_URL, TwitterObject::SINGLE_USER_URL

Instance Attribute Summary

Attributes inherited from TwitterObject

#base, #data

Instance Method Summary collapse

Methods inherited from TwitterObject

attrs, #from_json, #get_tweet_data, #get_user_data, #load_all, #load_tweet_data, #load_user_data, tweet_writer, user_writer

Constructor Details

#initialize(base, data = nil) {|_self| ... } ⇒ DirectMessage

Returns a new instance of DirectMessage.

Yields:

  • (_self)

Yield Parameters:



10
11
12
13
14
# File 'lib/userstream/event/direct_message.rb', line 10

def initialize(base, data = nil)
	@base = base
	from_json(data['direct_message']) if data and data['direct_message']
	yield self if block_given?
end

Instance Method Details

#loaded?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/userstream/event/direct_message.rb', line 20

def loaded?
  !text.nil?
end

#tweet_loadable_idObject



16
17
18
# File 'lib/userstream/event/direct_message.rb', line 16

def tweet_loadable_id
  id
end