Class: KiriminAja::Types::RequestPickupPackage

Inherits:
Object
  • Object
show all
Defined in:
lib/kiriminaja/types/order.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order_id:, destination_name:, destination_phone:, destination_address:, destination_kecamatan_id:, weight:, width:, length:, height:, item_value:, shipping_cost:, service:, service_type:, cod:, package_type_id:, item_name:, destination_kelurahan_id: nil, destination_zipcode: nil, qty: nil, insurance_amount: nil, drop: nil, note: nil) ⇒ RequestPickupPackage

Returns a new instance of RequestPickupPackage.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/kiriminaja/types/order.rb', line 13

def initialize(order_id:, destination_name:, destination_phone:, destination_address:,
               destination_kecamatan_id:, weight:, width:, length:, height:,
               item_value:, shipping_cost:, service:, service_type:, cod:,
               package_type_id:, item_name:,
               destination_kelurahan_id: nil, destination_zipcode: nil, qty: nil,
               insurance_amount: nil, drop: nil, note: nil)
  @order_id = order_id
  @destination_name = destination_name
  @destination_phone = destination_phone
  @destination_address = destination_address
  @destination_kecamatan_id = destination_kecamatan_id
  @weight = weight
  @width = width
  @length = length
  @height = height
  @item_value = item_value
  @shipping_cost = shipping_cost
  @service = service
  @service_type = service_type
  @cod = cod
  @package_type_id = package_type_id
  @item_name = item_name
  @destination_kelurahan_id = destination_kelurahan_id
  @destination_zipcode = destination_zipcode
  @qty = qty
  @insurance_amount = insurance_amount
  @drop = drop
  @note = note
end

Instance Attribute Details

#codObject

Returns the value of attribute cod.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def cod
  @cod
end

#destination_addressObject

Returns the value of attribute destination_address.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def destination_address
  @destination_address
end

#destination_kecamatan_idObject

Returns the value of attribute destination_kecamatan_id.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def destination_kecamatan_id
  @destination_kecamatan_id
end

#destination_kelurahan_idObject

Returns the value of attribute destination_kelurahan_id.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def destination_kelurahan_id
  @destination_kelurahan_id
end

#destination_nameObject

Returns the value of attribute destination_name.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def destination_name
  @destination_name
end

#destination_phoneObject

Returns the value of attribute destination_phone.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def destination_phone
  @destination_phone
end

#destination_zipcodeObject

Returns the value of attribute destination_zipcode.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def destination_zipcode
  @destination_zipcode
end

#dropObject

Returns the value of attribute drop.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def drop
  @drop
end

#heightObject

Returns the value of attribute height.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def height
  @height
end

#insurance_amountObject

Returns the value of attribute insurance_amount.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def insurance_amount
  @insurance_amount
end

#item_nameObject

Returns the value of attribute item_name.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def item_name
  @item_name
end

#item_valueObject

Returns the value of attribute item_value.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def item_value
  @item_value
end

#lengthObject

Returns the value of attribute length.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def length
  @length
end

#noteObject

Returns the value of attribute note.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def note
  @note
end

#order_idObject

Returns the value of attribute order_id.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def order_id
  @order_id
end

#package_type_idObject

Returns the value of attribute package_type_id.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def package_type_id
  @package_type_id
end

#qtyObject

Returns the value of attribute qty.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def qty
  @qty
end

#serviceObject

Returns the value of attribute service.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def service
  @service
end

#service_typeObject

Returns the value of attribute service_type.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def service_type
  @service_type
end

#shipping_costObject

Returns the value of attribute shipping_cost.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def shipping_cost
  @shipping_cost
end

#weightObject

Returns the value of attribute weight.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def weight
  @weight
end

#widthObject

Returns the value of attribute width.



6
7
8
# File 'lib/kiriminaja/types/order.rb', line 6

def width
  @width
end

Instance Method Details

#to_hObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/kiriminaja/types/order.rb', line 43

def to_h
  d = {
    order_id: @order_id,
    destination_name: @destination_name,
    destination_phone: @destination_phone,
    destination_address: @destination_address,
    destination_kecamatan_id: @destination_kecamatan_id,
    weight: @weight,
    width: @width,
    length: @length,
    height: @height,
    item_value: @item_value,
    shipping_cost: @shipping_cost,
    service: @service,
    service_type: @service_type,
    cod: @cod,
    package_type_id: @package_type_id,
    item_name: @item_name,
  }
  d[:destination_kelurahan_id] = @destination_kelurahan_id unless @destination_kelurahan_id.nil?
  d[:destination_zipcode] = @destination_zipcode unless @destination_zipcode.nil?
  d[:qty] = @qty unless @qty.nil?
  d[:insurance_amount] = @insurance_amount unless @insurance_amount.nil?
  d[:drop] = @drop unless @drop.nil?
  d[:note] = @note unless @note.nil?
  d
end