Class: Twitter::Place

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

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Base

#[], #initialize, lazy_attr_reader

Constructor Details

This class inherits a constructor from Twitter::Base

Instance Method Details

#==(other) ⇒ Boolean

Parameters:

  • other (Twiter::Place)

Returns:

  • (Boolean)


11
12
13
# File 'lib/twitter/place.rb', line 11

def ==(other)
  super || (other.class == self.class && other.id == self.id)
end

#bounding_boxTwitter::Point, Twitter::Polygon



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

def bounding_box
  @bounding_box ||= Twitter::GeoFactory.new(@attrs['bounding_box']) unless @attrs['bounding_box'].nil?
end

#country_codeString

Returns:

  • (String)


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

def country_code
  @country_code ||= @attrs['country_code'] || @attrs['countryCode']
end

#parent_idInteger

Returns:

  • (Integer)


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

def parent_id
  @parent_id ||= @attrs['parentid']
end

#place_typeString

Returns:

  • (String)


31
32
33
# File 'lib/twitter/place.rb', line 31

def place_type
  @place_type ||= @attrs['place_type'] || @attrs['placeType'] && @attrs['placeType']['name']
end