Class: Depots
- Inherits:
-
Object
- Object
- Depots
- Defined in:
- lib/arcgis_vrps/depots.rb
Instance Method Summary collapse
-
#addDepots(xCoordinate, yCoordinate, depotAttributeObj) ⇒ Object
Longitude => xCoordinate, Latitude => yCoordinate.
- #getDepotArr ⇒ Object
- #getDepotAttributeObj(depotName, timeStart, timeEnd) ⇒ Object
-
#getDepotObj(wkid) ⇒ Object
return depotAttributeObj end.
Instance Method Details
#addDepots(xCoordinate, yCoordinate, depotAttributeObj) ⇒ Object
Longitude => xCoordinate, Latitude => yCoordinate
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/arcgis_vrps/depots.rb', line 3 def addDepots (xCoordinate, yCoordinate, depotAttributeObj) my_depot = { :geometry => { :x => xCoordinate, :y => yCoordinate }, :attributes => depotAttributeObj } if @depotArr.nil? @depotArr = [] end @depotArr.push(my_depot) end |
#getDepotArr ⇒ Object
18 19 20 |
# File 'lib/arcgis_vrps/depots.rb', line 18 def getDepotArr return @depotArr end |
#getDepotAttributeObj(depotName, timeStart, timeEnd) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/arcgis_vrps/depots.rb', line 22 def getDepotAttributeObj(depotName, timeStart, timeEnd) depotAttributeObj = { :Name => depotName, :TimeWindowStart1 => timeStart, :TimeWindowEnd1 => timeEnd } return depotAttributeObj end |
#getDepotObj(wkid) ⇒ Object
return depotAttributeObj end
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/arcgis_vrps/depots.rb', line 43 def getDepotObj (wkid) if wkid.nil? depotObj = { :features => @depotArr } else depotObj = { :spatialReference => { :wkid => wkid }, :features => @depotArr } end return depotObj end |