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, items: nil) ⇒ RequestPickupPackage

Returns a new instance of RequestPickupPackage.



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/kiriminaja/types/order.rb', line 59

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, items: 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
  @items = items
end

Instance Attribute Details

#codObject

Returns the value of attribute cod.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def cod
  @cod
end

#destination_addressObject

Returns the value of attribute destination_address.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def destination_address
  @destination_address
end

#destination_kecamatan_idObject

Returns the value of attribute destination_kecamatan_id.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def destination_kecamatan_id
  @destination_kecamatan_id
end

#destination_kelurahan_idObject

Returns the value of attribute destination_kelurahan_id.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def destination_kelurahan_id
  @destination_kelurahan_id
end

#destination_nameObject

Returns the value of attribute destination_name.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def destination_name
  @destination_name
end

#destination_phoneObject

Returns the value of attribute destination_phone.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def destination_phone
  @destination_phone
end

#destination_zipcodeObject

Returns the value of attribute destination_zipcode.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def destination_zipcode
  @destination_zipcode
end

#dropObject

Returns the value of attribute drop.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def drop
  @drop
end

#heightObject

Returns the value of attribute height.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def height
  @height
end

#insurance_amountObject

Returns the value of attribute insurance_amount.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def insurance_amount
  @insurance_amount
end

#item_nameObject

Returns the value of attribute item_name.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def item_name
  @item_name
end

#item_valueObject

Returns the value of attribute item_value.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def item_value
  @item_value
end

#itemsObject

Returns the value of attribute items.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def items
  @items
end

#lengthObject

Returns the value of attribute length.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def length
  @length
end

#noteObject

Returns the value of attribute note.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def note
  @note
end

#order_idObject

Returns the value of attribute order_id.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def order_id
  @order_id
end

#package_type_idObject

Returns the value of attribute package_type_id.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def package_type_id
  @package_type_id
end

#qtyObject

Returns the value of attribute qty.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def qty
  @qty
end

#serviceObject

Returns the value of attribute service.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def service
  @service
end

#service_typeObject

Returns the value of attribute service_type.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def service_type
  @service_type
end

#shipping_costObject

Returns the value of attribute shipping_cost.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def shipping_cost
  @shipping_cost
end

#weightObject

Returns the value of attribute weight.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def weight
  @weight
end

#widthObject

Returns the value of attribute width.



52
53
54
# File 'lib/kiriminaja/types/order.rb', line 52

def width
  @width
end

Instance Method Details

#to_hObject



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/kiriminaja/types/order.rb', line 90

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[:items] = @items.map(&:to_h) unless @items.nil?
  d
end