Class: CurrentLocation
- Inherits:
-
Object
- Object
- CurrentLocation
- Defined in:
- lib/response/location/CurrentLocation.rb
Instance Method Summary collapse
- #getAccuracy ⇒ Object
- #getAltitude ⇒ Object
- #getLatitude ⇒ Object
- #getLongitude ⇒ Object
- #getTimestamp ⇒ Object
-
#initialize ⇒ CurrentLocation
constructor
A new instance of CurrentLocation.
- #initializeJSON(jsondict) ⇒ Object
- #setAccuracy(accuracy) ⇒ Object
- #setAltitude(altitude) ⇒ Object
- #setLatitude(latitude) ⇒ Object
- #setLongitude(longitude) ⇒ Object
- #setTimestamp(timestamp) ⇒ Object
Constructor Details
#initialize ⇒ CurrentLocation
Returns a new instance of CurrentLocation.
4 5 6 7 8 9 10 |
# File 'lib/response/location/CurrentLocation.rb', line 4 def initialize @latitude=0.0 @longitude=0.0 @altitude=0.0 @accuracy=0.0 =nil end |
Instance Method Details
#getAccuracy ⇒ Object
59 60 61 |
# File 'lib/response/location/CurrentLocation.rb', line 59 def getAccuracy @accuracy end |
#getAltitude ⇒ Object
51 52 53 |
# File 'lib/response/location/CurrentLocation.rb', line 51 def getAltitude @altitude end |
#getLatitude ⇒ Object
35 36 37 |
# File 'lib/response/location/CurrentLocation.rb', line 35 def getLatitude @latitude end |
#getLongitude ⇒ Object
43 44 45 |
# File 'lib/response/location/CurrentLocation.rb', line 43 def getLongitude @longitude end |
#getTimestamp ⇒ Object
67 68 69 |
# File 'lib/response/location/CurrentLocation.rb', line 67 def getTimestamp end |
#initializeJSON(jsondict) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/response/location/CurrentLocation.rb', line 12 def initializeJSON(jsondict) @latitude=0.0 if (jsondict!=nil) && (jsondict.has_key?'latitude') && (jsondict['latitude']!=nil) @latitude=jsondict['latitude'].to_f end @longitude=0.0 if (jsondict!=nil) && (jsondict.has_key?'longitude') && (jsondict['longitude']!=nil) @longitude=jsondict['longitude'].to_f end @altitude=0.0 if (jsondict!=nil) && (jsondict.has_key?'altitude') && (jsondict['altitude']!=nil) @altitude=jsondict['altitude'].to_f end @accuracy=0.0 if (jsondict!=nil) && (jsondict.has_key?'accuracy') && (jsondict['accuracy']!=nil) @accuracy=jsondict['accuracy'].to_f end =nil if (jsondict!=nil) && (jsondict.has_key?'timestamp') && (jsondict['timestamp']!=nil) =jsondict['timestamp'] end end |
#setAccuracy(accuracy) ⇒ Object
63 64 65 |
# File 'lib/response/location/CurrentLocation.rb', line 63 def setAccuracy(accuracy) @accuracy=accuracy end |
#setAltitude(altitude) ⇒ Object
55 56 57 |
# File 'lib/response/location/CurrentLocation.rb', line 55 def setAltitude(altitude) @altitude=altitude end |
#setLatitude(latitude) ⇒ Object
39 40 41 |
# File 'lib/response/location/CurrentLocation.rb', line 39 def setLatitude(latitude) @latitude=latitude end |
#setLongitude(longitude) ⇒ Object
47 48 49 |
# File 'lib/response/location/CurrentLocation.rb', line 47 def setLongitude(longitude) @longitude=longitude end |
#setTimestamp(timestamp) ⇒ Object
71 72 73 |
# File 'lib/response/location/CurrentLocation.rb', line 71 def setTimestamp() = end |