Class: KiriminAja::Types::RequestPickupItem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, price:, qty:, weight:, width: nil, length: nil, height: nil, metadata: nil) ⇒ RequestPickupItem

Returns a new instance of RequestPickupItem.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/kiriminaja/types/order.rb', line 24

def initialize(name:, price:, qty:, weight:,
               width: nil, length: nil, height: nil, metadata: nil)
  @name = name
  @price = price
  @qty = qty
  @weight = weight
  @width = width
  @length = length
  @height = height
  @metadata = 
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



22
23
24
# File 'lib/kiriminaja/types/order.rb', line 22

def height
  @height
end

#lengthObject

Returns the value of attribute length.



22
23
24
# File 'lib/kiriminaja/types/order.rb', line 22

def length
  @length
end

#metadataObject

Returns the value of attribute metadata.



22
23
24
# File 'lib/kiriminaja/types/order.rb', line 22

def 
  @metadata
end

#nameObject

Returns the value of attribute name.



22
23
24
# File 'lib/kiriminaja/types/order.rb', line 22

def name
  @name
end

#priceObject

Returns the value of attribute price.



22
23
24
# File 'lib/kiriminaja/types/order.rb', line 22

def price
  @price
end

#qtyObject

Returns the value of attribute qty.



22
23
24
# File 'lib/kiriminaja/types/order.rb', line 22

def qty
  @qty
end

#weightObject

Returns the value of attribute weight.



22
23
24
# File 'lib/kiriminaja/types/order.rb', line 22

def weight
  @weight
end

#widthObject

Returns the value of attribute width.



22
23
24
# File 'lib/kiriminaja/types/order.rb', line 22

def width
  @width
end

Instance Method Details

#to_hObject



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/kiriminaja/types/order.rb', line 36

def to_h
  d = {
    name: @name,
    price: @price,
    qty: @qty,
    weight: @weight,
  }
  d[:width] = @width unless @width.nil?
  d[:length] = @length unless @length.nil?
  d[:height] = @height unless @height.nil?
  d[:metadata] = @metadata.to_h unless @metadata.nil?
  d
end