Sha256: 63253273a391ef4e1d05638b60a7818da4b73c5905c0e041bb22e3ef2808ca01

Contents?: true

Size: 853 Bytes

Versions: 1

Compression:

Stored size: 853 Bytes

Contents

require 'twitter/identity'

module Twitter
  class Place < Twitter::Identity
    attr_reader :attributes, :country, :full_name, :name, :woeid
    alias woe_id woeid
    object_attr_reader :GeoFactory, :bounding_box
    object_attr_reader :Place, :contained_within
    alias contained? contained_within?
    uri_attr_reader :uri

    # @return [String]
    def country_code
      memoize(:country_code) do
        @attrs[:country_code] || @attrs[:countryCode]
      end
    end

    # @return [Integer]
    def parent_id
      memoize(:parent_id) do
        @attrs[:parentid]
      end
    end

    # @return [String]
    def place_type
      memoize(:place_type) do
        @attrs[:place_type] || @attrs[:placeType] && @attrs[:placeType][:name]
      end
    end

    # return [Integer]
    def id
      @attrs[:id] || @attrs[:woeid]
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twitter-5.0.0.rc.1 lib/twitter/place.rb