Class: KiriminAja::Types::RequestPickupPayload

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address:, phone:, name:, kecamatan_id:, packages:, schedule:, zipcode: nil, kelurahan_id: nil, latitude: nil, longitude: nil, platform_name: nil) ⇒ RequestPickupPayload

Returns a new instance of RequestPickupPayload.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/kiriminaja/types/order.rb', line 76

def initialize(address:, phone:, name:, kecamatan_id:, packages:, schedule:,
               zipcode: nil, kelurahan_id: nil, latitude: nil, longitude: nil, platform_name: nil)
  @address = address
  @phone = phone
  @name = name
  @kecamatan_id = kecamatan_id
  @packages = packages
  @schedule = schedule
  @zipcode = zipcode
  @kelurahan_id = kelurahan_id
  @latitude = latitude
  @longitude = longitude
  @platform_name = platform_name
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def address
  @address
end

#kecamatan_idObject

Returns the value of attribute kecamatan_id.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def kecamatan_id
  @kecamatan_id
end

#kelurahan_idObject

Returns the value of attribute kelurahan_id.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def kelurahan_id
  @kelurahan_id
end

#latitudeObject

Returns the value of attribute latitude.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def longitude
  @longitude
end

#nameObject

Returns the value of attribute name.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def name
  @name
end

#packagesObject

Returns the value of attribute packages.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def packages
  @packages
end

#phoneObject

Returns the value of attribute phone.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def phone
  @phone
end

#platform_nameObject

Returns the value of attribute platform_name.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def platform_name
  @platform_name
end

#scheduleObject

Returns the value of attribute schedule.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def schedule
  @schedule
end

#zipcodeObject

Returns the value of attribute zipcode.



73
74
75
# File 'lib/kiriminaja/types/order.rb', line 73

def zipcode
  @zipcode
end

Instance Method Details

#to_hObject



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/kiriminaja/types/order.rb', line 91

def to_h
  d = {
    address: @address,
    phone: @phone,
    name: @name,
    kecamatan_id: @kecamatan_id,
    packages: @packages.map(&:to_h),
    schedule: @schedule,
  }
  d[:zipcode] = @zipcode unless @zipcode.nil?
  d[:kelurahan_id] = @kelurahan_id unless @kelurahan_id.nil?
  d[:latitude] = @latitude unless @latitude.nil?
  d[:longitude] = @longitude unless @longitude.nil?
  d[:platform_name] = @platform_name unless @platform_name.nil?
  d
end