Class: Twitter::Suggestion

Inherits:
Base
  • Object
show all
Defined in:
lib/twitter/suggestion.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/twitter/suggestion.rb', line 6

def name
  @name
end

#sizeObject (readonly)

Returns the value of attribute size.



6
7
8
# File 'lib/twitter/suggestion.rb', line 6

def size
  @size
end

#slugObject (readonly)

Returns the value of attribute slug.



6
7
8
# File 'lib/twitter/suggestion.rb', line 6

def slug
  @slug
end

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


10
11
12
# File 'lib/twitter/suggestion.rb', line 10

def ==(other)
  super || attr_equal(:slug, other) || attrs_equal(other)
end

#usersArray<Twitter::User>

Returns:



15
16
17
18
19
# File 'lib/twitter/suggestion.rb', line 15

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