Class: Locman::Visit
- Inherits:
-
Object
- Object
- Locman::Visit
- Defined in:
- lib/locman/visit.rb
Overview
This represents a single visit.
Instance Attribute Summary collapse
-
#arrived_at ⇒ Object
Returns the value of attribute arrived_at.
-
#departed_at ⇒ Object
Returns the value of attribute departed_at.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
Class Method Summary collapse
-
.create_from_cl_visit(cl_visit) ⇒ Locman::Location
Creates a new Locman::Location instance from CLVisit object.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Locman::Location
constructor
Creates a new Locman::Location instance.
Constructor Details
#initialize(options = {}) ⇒ Locman::Location
Creates a new Locman::Location instance.
21 22 23 24 |
# File 'lib/locman/visit.rb', line 21 def initialize( = {}) .each { |key, value| send("#{key}=", value) } self end |
Instance Attribute Details
#arrived_at ⇒ Object
Returns the value of attribute arrived_at.
4 5 6 |
# File 'lib/locman/visit.rb', line 4 def arrived_at @arrived_at end |
#departed_at ⇒ Object
Returns the value of attribute departed_at.
4 5 6 |
# File 'lib/locman/visit.rb', line 4 def departed_at @departed_at end |
#latitude ⇒ Object
Returns the value of attribute latitude.
4 5 6 |
# File 'lib/locman/visit.rb', line 4 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
4 5 6 |
# File 'lib/locman/visit.rb', line 4 def longitude @longitude end |
Class Method Details
.create_from_cl_visit(cl_visit) ⇒ Locman::Location
Creates a new Locman::Location instance from CLVisit object.
9 10 11 12 13 14 15 16 |
# File 'lib/locman/visit.rb', line 9 def self.create_from_cl_visit(cl_visit) Locman::Visit.new( latitude: cl_visit.coordinate.latitude, longitude: cl_visit.coordinate.longitude, departed_at: cl_visit.departureDate, arrived_at: cl_visit.arrivalDate ) end |