Class: Twitter::Place

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

Instance Attribute Summary (collapse)

Attributes inherited from Base

#attrs

Instance Method Summary (collapse)

Methods inherited from Base

#[], attr_reader, display_uri_attr_reader, #initialize, object_attr_reader, uri_attr_reader

Methods included from Utils

flat_pmap, pmap, pmap_with_index

Constructor Details

This class inherits a constructor from Twitter::Base

Instance Attribute Details

- (Object) attributes (readonly)

Returns the value of attribute attributes



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

def attributes
  @attributes
end

- (Object) country (readonly)

Returns the value of attribute country



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

def country
  @country
end

- (Object) full_name (readonly)

Returns the value of attribute full_name



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

def full_name
  @full_name
end

- (Object) name (readonly)

Returns the value of attribute name



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

def name
  @name
end

- (Object) woeid (readonly) Also known as: woe_id

Returns the value of attribute woeid



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

def woeid
  @woeid
end

Instance Method Details

- (Boolean) ==(other)

Parameters:

Returns:

  • (Boolean)


21
22
23
24
# File 'lib/twitter/place.rb', line 21

def ==(other)
  other = coerce(other) if respond_to?(:coerce, true)
  super || kind_of?(self.class) && !woeid.nil? && other.respond_to?(:woeid) && woeid == other.woeid
end

- (String) country_code

Returns:

  • (String)


27
28
29
# File 'lib/twitter/place.rb', line 27

def country_code
  @attrs[:country_code] || @attrs[:countryCode] # rubocop:disable SymbolName
end

- (Boolean) eql?(other)

Parameters:

Returns:

  • (Boolean)


15
16
17
# File 'lib/twitter/place.rb', line 15

def eql?(other)
  super || instance_of?(other.class) && !woeid.nil? && other.respond_to?(:woeid) && woeid.eql?(other.woeid)
end

- (Integer) parent_id

Returns:

  • (Integer)


33
34
35
# File 'lib/twitter/place.rb', line 33

def parent_id
  @attrs[:parentid]
end

- (String) place_type

Returns:

  • (String)


39
40
41
# File 'lib/twitter/place.rb', line 39

def place_type
  @attrs[:place_type] || @attrs[:placeType] && @attrs[:placeType][:name] # rubocop:disable SymbolName
end