Class: Routes

Inherits:
Object
  • Object
show all
Defined in:
lib/arcgis_vrps/routes.rb

Instance Method Summary collapse

Instance Method Details

#addRoutes(routeName, startDepotName, earliestStartTime, latestStartTime) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/arcgis_vrps/routes.rb', line 2

def addRoutes (routeName, startDepotName, earliestStartTime, latestStartTime)
	my_route = {
		        :attributes => {
		          :Name => routeName,
		          :StartDepotName => startDepotName, # Either this or EndDepotName must be present. This is a foreign key to the "Name" attribute in the depots param. Thus, the values MUST match
		          :EarliestStartTime  => earliestStartTime,
		          :LatestStartTime => latestStartTime
		        }
	    	}

	if @routeArr.nil?
		@routeArr = []
	end
	
	@routeArr.push(my_route)
end

#getRouteArrObject

@routeArr.push(my_route) end



45
46
47
# File 'lib/arcgis_vrps/routes.rb', line 45

def getRouteArr
	return @routeArr
end

#getRouteObjObject



49
50
51
52
53
54
55
# File 'lib/arcgis_vrps/routes.rb', line 49

def getRouteObj
	routeObj = {
		:features => @routeArr
	}

	return routeObj
end