Class: ShellDataReportingApIs::FuelConsumptionData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::FuelConsumptionData
- Defined in:
- lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb
Overview
FuelConsumptionData Model.
Instance Attribute Summary collapse
-
#account_name ⇒ String
Account Name.
-
#account_number ⇒ String
Account Number.
-
#card_group_id ⇒ Integer
Card group ID.
-
#card_group_name ⇒ String
Card group name.
-
#card_number ⇒ String
Card PAN.
-
#co2_produced ⇒ Float
Total Co2 produced.
-
#discount ⇒ Float
Total Discount.
-
#distance ⇒ Float
Distance in KM or Miles based on Customer and Colco Settings.
-
#driver_name ⇒ String
Driver name.
-
#fuel_consumption ⇒ Float
Total Fuel Consumption.
-
#fuel_net_amount ⇒ Float
Net Fuel Amount.
-
#fuel_tax ⇒ Float
Fuel Tax Amount.
-
#fuel_volume ⇒ Float
Total Fuel Volume in Litres.
-
#gross_non_fuel_expenses ⇒ Float
Gross Nonfuel Amount.
-
#initial_odometer ⇒ Float
First transaction odometer reading.
-
#last_odometer ⇒ Float
Last transaction odometer reading.
-
#license_number ⇒ String
Vehicle registration number.
-
#payer_name ⇒ String
Payment customer Name.
-
#payer_number ⇒ String
Payment customer number.
-
#transaction_count ⇒ Float
Total Transaction Count.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
Methods inherited from BaseModel
Constructor Details
#initialize(account_name = SKIP, account_number = SKIP, payer_name = SKIP, payer_number = SKIP, card_number = SKIP, card_group_id = SKIP, card_group_name = SKIP, driver_name = SKIP, license_number = SKIP, initial_odometer = SKIP, last_odometer = SKIP, distance = SKIP, fuel_consumption = SKIP, fuel_net_amount = SKIP, discount = SKIP, fuel_tax = SKIP, fuel_volume = SKIP, gross_non_fuel_expenses = SKIP, co2_produced = SKIP, transaction_count = SKIP) ⇒ FuelConsumptionData
Returns a new instance of FuelConsumptionData.
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 170 def initialize(account_name = SKIP, account_number = SKIP, payer_name = SKIP, payer_number = SKIP, card_number = SKIP, card_group_id = SKIP, card_group_name = SKIP, driver_name = SKIP, license_number = SKIP, initial_odometer = SKIP, last_odometer = SKIP, distance = SKIP, fuel_consumption = SKIP, fuel_net_amount = SKIP, discount = SKIP, fuel_tax = SKIP, fuel_volume = SKIP, gross_non_fuel_expenses = SKIP, co2_produced = SKIP, transaction_count = SKIP) @account_name = account_name unless account_name == SKIP @account_number = account_number unless account_number == SKIP @payer_name = payer_name unless payer_name == SKIP @payer_number = payer_number unless payer_number == SKIP @card_number = card_number unless card_number == SKIP @card_group_id = card_group_id unless card_group_id == SKIP @card_group_name = card_group_name unless card_group_name == SKIP @driver_name = driver_name unless driver_name == SKIP @license_number = license_number unless license_number == SKIP @initial_odometer = initial_odometer unless initial_odometer == SKIP @last_odometer = last_odometer unless last_odometer == SKIP @distance = distance unless distance == SKIP @fuel_consumption = fuel_consumption unless fuel_consumption == SKIP @fuel_net_amount = fuel_net_amount unless fuel_net_amount == SKIP @discount = discount unless discount == SKIP @fuel_tax = fuel_tax unless fuel_tax == SKIP @fuel_volume = fuel_volume unless fuel_volume == SKIP @gross_non_fuel_expenses = gross_non_fuel_expenses unless gross_non_fuel_expenses == SKIP @co2_produced = co2_produced unless co2_produced == SKIP @transaction_count = transaction_count unless transaction_count == SKIP end |
Instance Attribute Details
#account_name ⇒ String
Account Name
14 15 16 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 14 def account_name @account_name end |
#account_number ⇒ String
Account Number
18 19 20 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 18 def account_number @account_number end |
#card_group_id ⇒ Integer
Card group ID
34 35 36 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 34 def card_group_id @card_group_id end |
#card_group_name ⇒ String
Card group name
38 39 40 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 38 def card_group_name @card_group_name end |
#card_number ⇒ String
Card PAN
30 31 32 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 30 def card_number @card_number end |
#co2_produced ⇒ Float
Total Co2 produced
86 87 88 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 86 def co2_produced @co2_produced end |
#discount ⇒ Float
Total Discount
70 71 72 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 70 def discount @discount end |
#distance ⇒ Float
Distance in KM or Miles based on Customer and Colco Settings
58 59 60 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 58 def distance @distance end |
#driver_name ⇒ String
Driver name
42 43 44 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 42 def driver_name @driver_name end |
#fuel_consumption ⇒ Float
Total Fuel Consumption.
62 63 64 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 62 def fuel_consumption @fuel_consumption end |
#fuel_net_amount ⇒ Float
Net Fuel Amount
66 67 68 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 66 def fuel_net_amount @fuel_net_amount end |
#fuel_tax ⇒ Float
Fuel Tax Amount
74 75 76 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 74 def fuel_tax @fuel_tax end |
#fuel_volume ⇒ Float
Total Fuel Volume in Litres
78 79 80 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 78 def fuel_volume @fuel_volume end |
#gross_non_fuel_expenses ⇒ Float
Gross Nonfuel Amount
82 83 84 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 82 def gross_non_fuel_expenses @gross_non_fuel_expenses end |
#initial_odometer ⇒ Float
First transaction odometer reading
50 51 52 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 50 def initial_odometer @initial_odometer end |
#last_odometer ⇒ Float
Last transaction odometer reading
54 55 56 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 54 def last_odometer @last_odometer end |
#license_number ⇒ String
Vehicle registration number
46 47 48 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 46 def license_number @license_number end |
#payer_name ⇒ String
Payment customer Name
22 23 24 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 22 def payer_name @payer_name end |
#payer_number ⇒ String
Payment customer number
26 27 28 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 26 def payer_number @payer_number end |
#transaction_count ⇒ Float
Total Transaction Count
90 91 92 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 90 def transaction_count @transaction_count end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 202 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_name = hash.key?('AccountName') ? hash['AccountName'] : SKIP account_number = hash.key?('AccountNumber') ? hash['AccountNumber'] : SKIP payer_name = hash.key?('PayerName') ? hash['PayerName'] : SKIP payer_number = hash.key?('PayerNumber') ? hash['PayerNumber'] : SKIP card_number = hash.key?('CardNumber') ? hash['CardNumber'] : SKIP card_group_id = hash.key?('CardGroupId') ? hash['CardGroupId'] : SKIP card_group_name = hash.key?('CardGroupName') ? hash['CardGroupName'] : SKIP driver_name = hash.key?('DriverName') ? hash['DriverName'] : SKIP license_number = hash.key?('LicenseNumber') ? hash['LicenseNumber'] : SKIP initial_odometer = hash.key?('InitialOdometer') ? hash['InitialOdometer'] : SKIP last_odometer = hash.key?('LastOdometer') ? hash['LastOdometer'] : SKIP distance = hash.key?('Distance') ? hash['Distance'] : SKIP fuel_consumption = hash.key?('FuelConsumption') ? hash['FuelConsumption'] : SKIP fuel_net_amount = hash.key?('FuelNetAmount') ? hash['FuelNetAmount'] : SKIP discount = hash.key?('Discount') ? hash['Discount'] : SKIP fuel_tax = hash.key?('FuelTax') ? hash['FuelTax'] : SKIP fuel_volume = hash.key?('FuelVolume') ? hash['FuelVolume'] : SKIP gross_non_fuel_expenses = hash.key?('GrossNonFuelExpenses') ? hash['GrossNonFuelExpenses'] : SKIP co2_produced = hash.key?('CO2Produced') ? hash['CO2Produced'] : SKIP transaction_count = hash.key?('TransactionCount') ? hash['TransactionCount'] : SKIP # Create object from extracted values. FuelConsumptionData.new(account_name, account_number, payer_name, payer_number, card_number, card_group_id, card_group_name, driver_name, license_number, initial_odometer, last_odometer, distance, fuel_consumption, fuel_net_amount, discount, fuel_tax, fuel_volume, gross_non_fuel_expenses, co2_produced, transaction_count) end |
.names ⇒ Object
A mapping from model property names to API property names.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 93 def self.names @_hash = {} if @_hash.nil? @_hash['account_name'] = 'AccountName' @_hash['account_number'] = 'AccountNumber' @_hash['payer_name'] = 'PayerName' @_hash['payer_number'] = 'PayerNumber' @_hash['card_number'] = 'CardNumber' @_hash['card_group_id'] = 'CardGroupId' @_hash['card_group_name'] = 'CardGroupName' @_hash['driver_name'] = 'DriverName' @_hash['license_number'] = 'LicenseNumber' @_hash['initial_odometer'] = 'InitialOdometer' @_hash['last_odometer'] = 'LastOdometer' @_hash['distance'] = 'Distance' @_hash['fuel_consumption'] = 'FuelConsumption' @_hash['fuel_net_amount'] = 'FuelNetAmount' @_hash['discount'] = 'Discount' @_hash['fuel_tax'] = 'FuelTax' @_hash['fuel_volume'] = 'FuelVolume' @_hash['gross_non_fuel_expenses'] = 'GrossNonFuelExpenses' @_hash['co2_produced'] = 'CO2Produced' @_hash['transaction_count'] = 'TransactionCount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 145 def self.nullables %w[ account_name account_number payer_name payer_number card_number card_group_id card_group_name driver_name license_number initial_odometer last_odometer distance fuel_consumption fuel_net_amount discount fuel_tax fuel_volume gross_non_fuel_expenses co2_produced transaction_count ] end |
.optionals ⇒ Object
An array for optional fields
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/shell_data_reporting_ap_is/models/fuel_consumption_data.rb', line 119 def self.optionals %w[ account_name account_number payer_name payer_number card_number card_group_id card_group_name driver_name license_number initial_odometer last_odometer distance fuel_consumption fuel_net_amount discount fuel_tax fuel_volume gross_non_fuel_expenses co2_produced transaction_count ] end |