Class: Twitter::Action::Mention

Inherits:
Base
  • Object
show all
Includes:
Creatable
Defined in:
lib/hackeroo/action/mention.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#max_positionObject (readonly)

Returns the value of attribute max_position.



8
9
10
# File 'lib/hackeroo/action/mention.rb', line 8

def max_position
  @max_position
end

#min_positionObject (readonly)

Returns the value of attribute min_position.



8
9
10
# File 'lib/hackeroo/action/mention.rb', line 8

def min_position
  @min_position
end

Instance Method Details

#sourceTwitter::User

The user who mentioned a user

Returns:

  • (Twitter::User)


22
23
24
# File 'lib/hackeroo/action/mention.rb', line 22

def source
  @source = sources.first
end

#sourcesArray<Twitter::User>

A collection of users who mentioned a user

Returns:

  • (Array<Twitter::User>)


13
14
15
16
17
# File 'lib/hackeroo/action/mention.rb', line 13

def sources
  @sources = Array(@attrs[:sources]).map do |user|
    Twitter::User.fetch_or_new(user)
  end
end

#target_objectsArray<Twitter::Tweet>

A collection of tweets that mention a user

Returns:

  • (Array<Twitter::Tweet>)


29
30
31
32
33
# File 'lib/hackeroo/action/mention.rb', line 29

def target_objects
  @target_objects = Array(@attrs[:target_objects]).map do |tweet|
    Twitter::Tweet.fetch_or_new(tweet)
  end
end

#targetsArray<Twitter::User>

A collection containing the mentioned user

Returns:

  • (Array<Twitter::User>)


38
39
40
41
42
# File 'lib/hackeroo/action/mention.rb', line 38

def targets
  @targets = Array(@attrs[:targets]).map do |user|
    Twitter::User.fetch_or_new(user)
  end
end