class Locman::Location
This represents a single location point.
Attributes
accuracy[RW]
@return [Float] Latitude and longitude measurement accuracy, in meters.
altitude[RW]
@return [Float] Altitude distance measurement of the location, in meters.
altitude_accuracy[RW]
@return [Float] Altitude measurement accuracy, in meters.
determined_at[RW]
@return [Time] The time at which this location was determined
floor[RW]
@return [Integer] The logical floor of the building.
latitude[RW]
@return [Float] Latitude coordinate of the location.
longitude[RW]
@return [Float] Longitude coordinate of the location
Public Class Methods
create_from_cl_location(cl_location)
click to toggle source
Creates a new Locman::Location
instance from CLLocation object. @param cl_location [CLLocation] @return [Locman::Location]
# File lib/locman/location.rb, line 28 def self.create_from_cl_location(cl_location) Locman::Location.new( latitude: cl_location.coordinate.latitude, longitude: cl_location.coordinate.longitude, altitude: cl_location.altitude, floor: cl_location.floor.nil? ? nil : cl_location.floor.level, accuracy: cl_location.horizontalAccuracy, altitude_accuracy: cl_location.verticalAccuracy, determined_at: cl_location.timestamp ) end
new(options = {})
click to toggle source
Creates a new Locman::Location
instance. @param options [Hash] Attributes that will be assigned on instance creation @return [Locman::Location]
# File lib/locman/location.rb, line 43 def initialize(options = {}) options.each { |key, value| send("#{key}=", value) } self end