Class: SpreeCmCommissioner::IntercityTaxiOrder::Update

Inherits:
Object
  • Object
show all
Defined in:
app/services/spree_cm_commissioner/intercity_taxi_order/update.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order:, order_params:) ⇒ Update

Returns a new instance of Update.



10
11
12
13
# File 'app/services/spree_cm_commissioner/intercity_taxi_order/update.rb', line 10

def initialize(order:, order_params:)
  @order = order
  @order_params = order_params
end

Instance Attribute Details

#orderObject (readonly)

Returns the value of attribute order.



4
5
6
# File 'app/services/spree_cm_commissioner/intercity_taxi_order/update.rb', line 4

def order
  @order
end

#order_paramsObject (readonly)

Returns the value of attribute order_params.



4
5
6
# File 'app/services/spree_cm_commissioner/intercity_taxi_order/update.rb', line 4

def order_params
  @order_params
end

Class Method Details

.call(order:, order_params:) ⇒ Object



6
7
8
# File 'app/services/spree_cm_commissioner/intercity_taxi_order/update.rb', line 6

def self.call(order:, order_params:)
  new(order: order, order_params: order_params).call
end

Instance Method Details

#callObject



15
16
17
18
19
# File 'app/services/spree_cm_commissioner/intercity_taxi_order/update.rb', line 15

def call
  order.update!(order_params)

  order
end