Class: Twitter::Action::Mention
- Includes:
- Creatable
- Defined in:
- lib/twitter/action/mention.rb
Instance Attribute Summary collapse
-
#max_position ⇒ Object
readonly
Returns the value of attribute max_position.
-
#min_position ⇒ Object
readonly
Returns the value of attribute min_position.
Attributes inherited from Base
Instance Method Summary collapse
-
#source ⇒ Twitter::User
The user who mentioned a user.
-
#sources ⇒ Array<Twitter::User>
A collection of users who mentioned a user.
-
#target_objects ⇒ Array<Twitter::Tweet>
A collection of tweets that mention a user.
-
#targets ⇒ Array<Twitter::User>
A collection containing the mentioned user.
Methods included from Creatable
Methods inherited from Base
#[], attr_reader, fetch, fetch_or_new, from_response, identity_map, #initialize, store, #update
Constructor Details
This class inherits a constructor from Twitter::Base
Instance Attribute Details
#max_position ⇒ Object (readonly)
Returns the value of attribute max_position.
10 11 12 |
# File 'lib/twitter/action/mention.rb', line 10 def max_position @max_position end |
#min_position ⇒ Object (readonly)
Returns the value of attribute min_position.
10 11 12 |
# File 'lib/twitter/action/mention.rb', line 10 def min_position @min_position end |
Instance Method Details
#source ⇒ Twitter::User
The user who mentioned a user
24 25 26 |
# File 'lib/twitter/action/mention.rb', line 24 def source @source = sources.first end |
#sources ⇒ Array<Twitter::User>
A collection of users who mentioned a user
15 16 17 18 19 |
# File 'lib/twitter/action/mention.rb', line 15 def sources @sources = Array(@attrs[:sources]).map do |user| Twitter::User.fetch_or_new(user) end end |
#target_objects ⇒ Array<Twitter::Tweet>
A collection of tweets that mention a user
31 32 33 34 35 |
# File 'lib/twitter/action/mention.rb', line 31 def target_objects @target_objects = Array(@attrs[:target_objects]).map do |tweet| Twitter::Tweet.fetch_or_new(tweet) end end |
#targets ⇒ Array<Twitter::User>
A collection containing the mentioned user
40 41 42 43 44 |
# File 'lib/twitter/action/mention.rb', line 40 def targets @targets = Array(@attrs[:targets]).map do |user| Twitter::User.fetch_or_new(user) end end |