Class: Twitter::Place

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Identity

#==, fetch, #initialize, store

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



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

def attributes
  @attributes
end

#countryObject (readonly)

Returns the value of attribute country.



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

def country
  @country
end

#full_nameObject (readonly)

Returns the value of attribute full_name.



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

def full_name
  @full_name
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end

#woeidObject (readonly) Also known as: woe_id

Returns the value of attribute woeid.



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

def woeid
  @woeid
end

Instance Method Details

#bounding_boxTwitter::Geo

Returns:



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

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

#country_codeString

Returns:

  • (String)


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

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

#idObject



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

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

#parent_idInteger

Returns:

  • (Integer)


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

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

#place_typeString

Returns:

  • (String)


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

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