Class: ShellSmartPayApi::PrepareFuelingResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellSmartPayApi::PrepareFuelingResponse
- Defined in:
- lib/shell_smart_pay_api/models/prepare_fueling_response.rb
Overview
The response of prepare fueling returns
Instance Attribute Summary collapse
-
#mpp_transaction_id ⇒ String
The unique identifier of the Order.
-
#products ⇒ Array[String]
An array of Strings that contain the list of products that the user can purchase at the specified Station/Pump.
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
-
#initialize(mpp_transaction_id = nil, products = SKIP) ⇒ PrepareFuelingResponse
constructor
A new instance of PrepareFuelingResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(mpp_transaction_id = nil, products = SKIP) ⇒ PrepareFuelingResponse
Returns a new instance of PrepareFuelingResponse.
46 47 48 49 |
# File 'lib/shell_smart_pay_api/models/prepare_fueling_response.rb', line 46 def initialize(mpp_transaction_id = nil, products = SKIP) @mpp_transaction_id = mpp_transaction_id @products = products unless products == SKIP end |
Instance Attribute Details
#mpp_transaction_id ⇒ String
The unique identifier of the Order. NB at this stage the Customer hasn’t actually bought anything so there’s no formal transaction associated with the Order. A transaction is not processed until refuelling has been completed successfully and will be triggered by returning the nozzle to the pump.
18 19 20 |
# File 'lib/shell_smart_pay_api/models/prepare_fueling_response.rb', line 18 def mpp_transaction_id @mpp_transaction_id end |
#products ⇒ Array[String]
An array of Strings that contain the list of products that the user can purchase at the specified Station/Pump. The text is localized based on the country.
24 25 26 |
# File 'lib/shell_smart_pay_api/models/prepare_fueling_response.rb', line 24 def products @products end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/shell_smart_pay_api/models/prepare_fueling_response.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. mpp_transaction_id = hash.key?('mppTransactionId') ? hash['mppTransactionId'] : nil products = hash.key?('products') ? hash['products'] : SKIP # Create object from extracted values. PrepareFuelingResponse.new(mpp_transaction_id, products) end |
.names ⇒ Object
A mapping from model property names to API property names.
27 28 29 30 31 32 |
# File 'lib/shell_smart_pay_api/models/prepare_fueling_response.rb', line 27 def self.names @_hash = {} if @_hash.nil? @_hash['mpp_transaction_id'] = 'mppTransactionId' @_hash['products'] = 'products' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/shell_smart_pay_api/models/prepare_fueling_response.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
35 36 37 38 39 |
# File 'lib/shell_smart_pay_api/models/prepare_fueling_response.rb', line 35 def self.optionals %w[ products ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
72 73 74 75 76 |
# File 'lib/shell_smart_pay_api/models/prepare_fueling_response.rb', line 72 def inspect class_name = self.class.name.split('::').last "<#{class_name} mpp_transaction_id: #{@mpp_transaction_id.inspect}, products:"\ " #{@products.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
66 67 68 69 |
# File 'lib/shell_smart_pay_api/models/prepare_fueling_response.rb', line 66 def to_s class_name = self.class.name.split('::').last "<#{class_name} mpp_transaction_id: #{@mpp_transaction_id}, products: #{@products}>" end |