Class: RubyPtvApi::Operation::XTour::PlanSequence

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_ptv_api/operation/x_tour/plan_sequence.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#result_field_array, #search_option_base_array, #sort_option_array

Attributes inherited from Base

#coord_format, #profile

Instance Method Summary collapse

Methods inherited from Base

#call, #ptv_path

Methods inherited from Base

#connection, #default_params, #demodulize, #demodulized_name, #endpoint, #parent_module_name, #post, #ptv_path, #underscore, #uri

Constructor Details

#initialize(transport_orders:, depots:, vehicle:) ⇒ PlanSequence

Returns a new instance of PlanSequence.



7
8
9
10
11
12
# File 'lib/ruby_ptv_api/operation/x_tour/plan_sequence.rb', line 7

def initialize(transport_orders:, depots:, vehicle:)
  @transport_orders = transport_orders
  @depots = depots
  @vehicle = vehicle
  @dimaId = 1
end

Instance Attribute Details

#depotsObject (readonly)

Returns the value of attribute depots.



5
6
7
# File 'lib/ruby_ptv_api/operation/x_tour/plan_sequence.rb', line 5

def depots
  @depots
end

#transport_ordersObject (readonly)

Returns the value of attribute transport_orders.



5
6
7
# File 'lib/ruby_ptv_api/operation/x_tour/plan_sequence.rb', line 5

def transport_orders
  @transport_orders
end

#vehicleObject (readonly)

Returns the value of attribute vehicle.



5
6
7
# File 'lib/ruby_ptv_api/operation/x_tour/plan_sequence.rb', line 5

def vehicle
  @vehicle
end

Instance Method Details

#paramsObject



32
33
34
35
36
37
38
39
40
# File 'lib/ruby_ptv_api/operation/x_tour/plan_sequence.rb', line 32

def params
  { 
    transportOrders: transport_orders,
    depots: depots,
    vehicle: vehicle,
    sequencingParams: sequencing_params,
    inputPlan: nil
  }
end

#ptv_functionObject



14
15
16
# File 'lib/ruby_ptv_api/operation/x_tour/plan_sequence.rb', line 14

def ptv_function
  'planSequence'
end

#sequencing_paramsObject



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ruby_ptv_api/operation/x_tour/plan_sequence.rb', line 18

def sequencing_params
  RubyPtvApi::Model::XTour::SequencingParams.new({
    'coDriverTransportPointsInSeparateTours' => false,
    'distanceMatrixCalculation' => 
      [
          RubyPtvApi::Model::XTour::DistanceMatrixByRoad.new({
          'dimaId' => 1,
          'deleteBeforeUsage' => true,
          'deleteAfterUsage' => true
        })                
      ]
  })
end