Class: OnlinePayments::SDK::Domain::CarRentalData

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/car_rental_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#agreement_numberString?

Returns the current value of agreement_number.

Returns:

  • (String, nil)

    the current value of agreement_number



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def agreement_number
  @agreement_number
end

#cardholder_notifiedtrue/false?

Returns the current value of cardholder_notified.

Returns:

  • (true/false, nil)

    the current value of cardholder_notified



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def cardholder_notified
  @cardholder_notified
end

#charges_amountInteger?

Returns the current value of charges_amount.

Returns:

  • (Integer, nil)

    the current value of charges_amount



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def charges_amount
  @charges_amount
end

#charges_categoryString?

Returns the current value of charges_category.

Returns:

  • (String, nil)

    the current value of charges_category



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def charges_category
  @charges_category
end

#distance_measureInteger?

Returns the current value of distance_measure.

Returns:

  • (Integer, nil)

    the current value of distance_measure



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def distance_measure
  @distance_measure
end

#distance_unitString?

Returns the current value of distance_unit.

Returns:

  • (String, nil)

    the current value of distance_unit



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def distance_unit
  @distance_unit
end

#driver_identification_numberString?

Returns the current value of driver_identification_number.

Returns:

  • (String, nil)

    the current value of driver_identification_number



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def driver_identification_number
  @driver_identification_number
end

#driver_tax_numberString?

Returns the current value of driver_tax_number.

Returns:

  • (String, nil)

    the current value of driver_tax_number



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def driver_tax_number
  @driver_tax_number
end

#pickupOnlinePayments::SDK::Domain::CarRentalPickupReturnData?

Returns the current value of pickup.

Returns:



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def pickup
  @pickup
end

#rental_rate_amountInteger?

Returns the current value of rental_rate_amount.

Returns:

  • (Integer, nil)

    the current value of rental_rate_amount



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def rental_rate_amount
  @rental_rate_amount
end

#rental_rate_typeString?

Returns the current value of rental_rate_type.

Returns:

  • (String, nil)

    the current value of rental_rate_type



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def rental_rate_type
  @rental_rate_type
end

#renter_nameString?

Returns the current value of renter_name.

Returns:

  • (String, nil)

    the current value of renter_name



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def renter_name
  @renter_name
end

#returnOnlinePayments::SDK::Domain::CarRentalPickupReturnData?

Returns the current value of return.

Returns:



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def return
  @return
end

#tax_exempt_indicatortrue/false?

Returns the current value of tax_exempt_indicator.

Returns:

  • (true/false, nil)

    the current value of tax_exempt_indicator



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def tax_exempt_indicator
  @tax_exempt_indicator
end

#toll_free_numberString?

Returns the current value of toll_free_number.

Returns:

  • (String, nil)

    the current value of toll_free_number



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def toll_free_number
  @toll_free_number
end

#vehicleOnlinePayments::SDK::Domain::CarRentalVehicleData?

Returns the current value of vehicle.

Returns:



27
28
29
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 27

def vehicle
  @vehicle
end

Instance Method Details

#from_hash(hash) ⇒ Object



83
84
85
86
87
88
89
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 83

def from_hash(hash)
  super
  if hash.has_key? 'agreementNumber'
    @agreement_number = hash['agreementNumber']
  end
  if hash.has_key? 'cardholderNotified'
    @cardholder_notified = hash['cardholderNotified']
  end
  if hash.has_key? 'chargesAmount'
    @charges_amount = hash['chargesAmount']
  end
  if hash.has_key? 'chargesCategory'
    @charges_category = hash['chargesCategory']
  end
  if hash.has_key? 'distanceMeasure'
    @distance_measure = hash['distanceMeasure']
  end
  if hash.has_key? 'distanceUnit'
    @distance_unit = hash['distanceUnit']
  end
  if hash.has_key? 'driverIdentificationNumber'
    @driver_identification_number = hash['driverIdentificationNumber']
  end
  if hash.has_key? 'driverTaxNumber'
    @driver_tax_number = hash['driverTaxNumber']
  end
  if hash.has_key? 'pickup'
    raise TypeError, "value '%s' is not a Hash" % [hash['pickup']] unless hash['pickup'].is_a? Hash
    @pickup = OnlinePayments::SDK::Domain::CarRentalPickupReturnData.new_from_hash(hash['pickup'])
  end
  if hash.has_key? 'rentalRateAmount'
    @rental_rate_amount = hash['rentalRateAmount']
  end
  if hash.has_key? 'rentalRateType'
    @rental_rate_type = hash['rentalRateType']
  end
  if hash.has_key? 'renterName'
    @renter_name = hash['renterName']
  end
  if hash.has_key? 'return'
    raise TypeError, "value '%s' is not a Hash" % [hash['return']] unless hash['return'].is_a? Hash
    @return = OnlinePayments::SDK::Domain::CarRentalPickupReturnData.new_from_hash(hash['return'])
  end
  if hash.has_key? 'taxExemptIndicator'
    @tax_exempt_indicator = hash['taxExemptIndicator']
  end
  if hash.has_key? 'tollFreeNumber'
    @toll_free_number = hash['tollFreeNumber']
  end
  if hash.has_key? 'vehicle'
    raise TypeError, "value '%s' is not a Hash" % [hash['vehicle']] unless hash['vehicle'].is_a? Hash
    @vehicle = OnlinePayments::SDK::Domain::CarRentalVehicleData.new_from_hash(hash['vehicle'])
  end
end

#to_hHash

Returns:

  • (Hash)


62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/onlinepayments/sdk/domain/car_rental_data.rb', line 62

def to_h
  hash = super
  hash['agreementNumber'] = @agreement_number unless @agreement_number.nil?
  hash['cardholderNotified'] = @cardholder_notified unless @cardholder_notified.nil?
  hash['chargesAmount'] = @charges_amount unless @charges_amount.nil?
  hash['chargesCategory'] = @charges_category unless @charges_category.nil?
  hash['distanceMeasure'] = @distance_measure unless @distance_measure.nil?
  hash['distanceUnit'] = @distance_unit unless @distance_unit.nil?
  hash['driverIdentificationNumber'] = @driver_identification_number unless @driver_identification_number.nil?
  hash['driverTaxNumber'] = @driver_tax_number unless @driver_tax_number.nil?
  hash['pickup'] = @pickup.to_h unless @pickup.nil?
  hash['rentalRateAmount'] = @rental_rate_amount unless @rental_rate_amount.nil?
  hash['rentalRateType'] = @rental_rate_type unless @rental_rate_type.nil?
  hash['renterName'] = @renter_name unless @renter_name.nil?
  hash['return'] = @return.to_h unless @return.nil?
  hash['taxExemptIndicator'] = @tax_exempt_indicator unless @tax_exempt_indicator.nil?
  hash['tollFreeNumber'] = @toll_free_number unless @toll_free_number.nil?
  hash['vehicle'] = @vehicle.to_h unless @vehicle.nil?
  hash
end