Class: Rubyfocus::Location

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyfocus/location.rb

Overview

A location file. Really a collection of properties and initializer.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n) ⇒ Location

Returns a new instance of Location.



5
6
7
8
9
10
11
12
# File 'lib/rubyfocus/location.rb', line 5

def initialize(n)
	@notification_flags = 0
	self.name = n["name"]
	self.latitude = n["latitude"].to_f
	self.longitude = n["longitude"].to_f
	self.radius = n["radius"].to_i
	self.notification_flags = n["notificationFlags"].to_i
end

Instance Attribute Details

#latitudeObject

Returns the value of attribute latitude.



3
4
5
# File 'lib/rubyfocus/location.rb', line 3

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



3
4
5
# File 'lib/rubyfocus/location.rb', line 3

def longitude
  @longitude
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/rubyfocus/location.rb', line 3

def name
  @name
end

#notification_flagsObject

Returns the value of attribute notification_flags.



3
4
5
# File 'lib/rubyfocus/location.rb', line 3

def notification_flags
  @notification_flags
end

#radiusObject

Returns the value of attribute radius.



3
4
5
# File 'lib/rubyfocus/location.rb', line 3

def radius
  @radius
end

Instance Method Details

#inspectObject



14
15
16
# File 'lib/rubyfocus/location.rb', line 14

def inspect
	%|#<Rubyfocus::Location latitude="#{self.latitude}" longitude="#{self.longitude}">|
end