Class: Rubyfocus::Location
- Inherits:
-
Object
- Object
- Rubyfocus::Location
- Defined in:
- lib/rubyfocus/location.rb
Overview
A location file. Really a collection of properties and initializer.
Instance Attribute Summary collapse
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#name ⇒ Object
Returns the value of attribute name.
-
#notification_flags ⇒ Object
Returns the value of attribute notification_flags.
-
#radius ⇒ Object
Returns the value of attribute radius.
Instance Method Summary collapse
-
#initialize(n) ⇒ Location
constructor
A new instance of Location.
- #inspect ⇒ Object
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
#latitude ⇒ Object
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/rubyfocus/location.rb', line 3 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
3 4 5 |
# File 'lib/rubyfocus/location.rb', line 3 def longitude @longitude end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/rubyfocus/location.rb', line 3 def name @name end |
#notification_flags ⇒ Object
Returns the value of attribute notification_flags.
3 4 5 |
# File 'lib/rubyfocus/location.rb', line 3 def notification_flags @notification_flags end |
#radius ⇒ Object
Returns the value of attribute radius.
3 4 5 |
# File 'lib/rubyfocus/location.rb', line 3 def radius @radius end |
Instance Method Details
#inspect ⇒ Object
14 15 16 |
# File 'lib/rubyfocus/location.rb', line 14 def inspect %|#<Rubyfocus::Location latitude="#{self.latitude}" longitude="#{self.longitude}">| end |