Class: RubyPtvApi::Operation::XTour::PlanBasicTours

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_ptv_api/operation/x_tour/plan_basic_tours.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:, fleet:) ⇒ PlanBasicTours

Returns a new instance of PlanBasicTours.



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

def initialize(transport_orders:, depots:, fleet:)
  @transport_orders = transport_orders
  @depots = depots
  @fleet = fleet
end

Instance Attribute Details

#depotsObject (readonly)

Returns the value of attribute depots.



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

def depots
  @depots
end

#fleetObject (readonly)

Returns the value of attribute fleet.



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

def fleet
  @fleet
end

#transport_ordersObject (readonly)

Returns the value of attribute transport_orders.



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

def transport_orders
  @transport_orders
end

Instance Method Details

#paramsObject



30
31
32
33
34
35
36
37
38
# File 'lib/ruby_ptv_api/operation/x_tour/plan_basic_tours.rb', line 30

def params
  { 
    transportOrders: transport_orders,
    depots: depots,
    fleet: fleet,
    planningParams: planning_params,
    inputPlan: nil
  }
end

#planning_paramsObject



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

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

#ptv_functionObject



13
14
15
# File 'lib/ruby_ptv_api/operation/x_tour/plan_basic_tours.rb', line 13

def ptv_function
  'planBasicTours'
end