Class: Twitter::Place
- Inherits:
-
Identity
show all
- Includes:
- Memoizable
- Defined in:
- lib/twitter/place.rb
Instance Attribute Summary collapse
Attributes inherited from Identity
#id
Attributes inherited from Base
#attrs
Instance Method Summary
collapse
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, define_uri_method, display_uri_attr_reader, object_attr_reader, predicate_attr_reader, uri_attr_reader
Methods included from Utils
flat_pmap, pmap
Constructor Details
24
25
26
27
|
# File 'lib/twitter/place.rb', line 24
def initialize(attrs = {})
attrs[:id] ||= attrs.fetch(:woeid)
super
end
|
Instance Attribute Details
#attributes ⇒ Hash
9
10
11
|
# File 'lib/twitter/place.rb', line 9
def attributes
@attributes
end
|
#country ⇒ String
11
12
13
|
# File 'lib/twitter/place.rb', line 11
def country
@country
end
|
#full_name ⇒ String
11
12
13
|
# File 'lib/twitter/place.rb', line 11
def full_name
@full_name
end
|
#name ⇒ String
11
12
13
|
# File 'lib/twitter/place.rb', line 11
def name
@name
end
|
Instance Method Details
#country_code ⇒ String
30
31
32
|
# File 'lib/twitter/place.rb', line 30
def country_code
@attrs[:country_code] || @attrs[:countryCode]
end
|
#parent_id ⇒ Integer
36
37
38
|
# File 'lib/twitter/place.rb', line 36
def parent_id
@attrs[:parentid]
end
|
#place_type ⇒ String
42
43
44
|
# File 'lib/twitter/place.rb', line 42
def place_type
@attrs[:place_type] || (@attrs[:placeType] && @attrs[:placeType][:name])
end
|