Class: Twitter::Suggestion

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

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Base

#[], #attr_equal, attr_reader, #attrs, #attrs_equal, fetch, fetch_or_new, from_response, identity_map, #initialize, store, #update

Constructor Details

This class inherits a constructor from Twitter::Base

Instance Attribute Details

- (Object) name (readonly)

Returns the value of attribute name



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

def name
  @name
end

- (Object) size (readonly)

Returns the value of attribute size



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

def size
  @size
end

- (Object) slug (readonly)

Returns the value of attribute slug



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

def slug
  @slug
end

Instance Method Details

- (Boolean) ==(other)

Parameters:

Returns:

  • (Boolean)


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

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

- (Array<Twitter::User>) users

Returns:



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

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