Class: GSGraph::Location
- Inherits:
-
Object
- Object
- GSGraph::Location
- Includes:
- Comparison, Serialization
- Defined in:
- lib/gs_graph/location.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Location
constructor
A new instance of Location.
- #to_hash(options = {}) ⇒ Object
Methods included from Serialization
Methods included from Comparison
Constructor Details
#initialize(attributes = {}) ⇒ Location
Returns a new instance of Location.
8 9 10 11 |
# File 'lib/gs_graph/location.rb', line 8 def initialize(attributes = {}) @latitude = attributes[:latitude] @longitude = attributes[:longitude] end |
Instance Attribute Details
#latitude ⇒ Object
Returns the value of attribute latitude.
6 7 8 |
# File 'lib/gs_graph/location.rb', line 6 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
6 7 8 |
# File 'lib/gs_graph/location.rb', line 6 def longitude @longitude end |
Instance Method Details
#to_hash(options = {}) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/gs_graph/location.rb', line 13 def to_hash( = {}) { :latitude => self.latitude, :longitude => self.longitude } end |