Class: Twitter::Geo::Point

Inherits:
Twitter::Geo show all
Defined in:
lib/twitter/geo/point.rb

Overview

Represents a geographic point with latitude and longitude

Instance Attribute Summary

Attributes inherited from Twitter::Geo

#coordinates

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, #initialize, object_attr_reader, predicate_attr_reader, uri_attr_reader

Methods included from Utils

flat_pmap, pmap

Constructor Details

This class inherits a constructor from Twitter::Base

Instance Method Details

#latitudeFloat Also known as: lat

Returns the latitude of this point

Examples:

point.latitude

Returns:

  • (Float)


13
14
15
# File 'lib/twitter/geo/point.rb', line 13

def latitude
  coordinates[0]
end

#longitudeFloat Also known as: long, lng

Returns the longitude of this point

Examples:

point.longitude

Returns:

  • (Float)


31
32
33
# File 'lib/twitter/geo/point.rb', line 31

def longitude
  coordinates[1]
end