Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (39 sloc) 1.055 kB
require 'twitter/identity'
module Twitter
class Place < Twitter::Identity
attr_reader :attributes, :country, :full_name, :name, :url, :woeid
alias uri url
alias woe_id woeid
# @return [Twitter::Geo, Twitter::NullObject]
def bounding_box
new_or_null_object(Twitter::GeoFactory, :bounding_box)
end
# @return [Boolean]
def bounding_box?
!bounding_box.nil?
end
def contained_within
new_or_null_object(Twitter::Place, :contained_within)
end
# @return [Boolean]
def contained_within?
!contained_within.nil?
end
alias contained? contained_within?
# @return [String]
def country_code
@country_code ||= @attrs[:country_code] || @attrs[:countryCode]
end
# @return [Integer]
def parent_id
@parent_id ||= @attrs[:parentid]
end
# @return [String]
def place_type
@place_type ||= @attrs[:place_type] || @attrs[:placeType] && @attrs[:placeType][:name]
end
def id
@attrs[:id] || @attrs[:woeid]
end
end
end
Jump to Line
Something went wrong with that request. Please try again.