Class: Twitter::Place

Inherits:
Identity show all
Defined in:
lib/twitter/place.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Methods inherited from Identity

#==, fetch, #initialize, store

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::Identity

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

#countryObject (readonly)

Returns the value of attribute country.



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

def country
  @country
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



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

def full_name
  @full_name
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end

#woeidObject (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

#bounding_boxTwitter::Geo

Returns:



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

def bounding_box
  @bounding_box ||= Twitter::GeoFactory.fetch_or_new(@attrs[:bounding_box])
end

#country_codeString

Returns:



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

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

#idObject



29
30
31
# File 'lib/twitter/place.rb', line 29

def id
  @attrs[:id] || @attrs[:woeid]
end

#parent_idInteger

Returns:

  • (Integer)


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

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

#place_typeString

Returns:



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

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