Class: Worldline::Acquiring::SDK::Communication::MetadataProvider::ServerMetaInfo

Inherits:
Domain::DataObject
  • Object
show all
Defined in:
lib/worldline/acquiring/sdk/communication/metadata_provider.rb

Overview

Stores metadata about the server so it can be sent to the Worldline Acquiring platform

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#integratorObject

Returns the value of attribute integrator.



40
41
42
# File 'lib/worldline/acquiring/sdk/communication/metadata_provider.rb', line 40

def integrator
  @integrator
end

#platform_identifierObject

String containing system information (Operating system and Ruby version).



33
34
35
# File 'lib/worldline/acquiring/sdk/communication/metadata_provider.rb', line 33

def platform_identifier
  @platform_identifier
end

#sdk_creatorObject

Returns the value of attribute sdk_creator.



38
39
40
# File 'lib/worldline/acquiring/sdk/communication/metadata_provider.rb', line 38

def sdk_creator
  @sdk_creator
end

#sdk_identifierObject

String containing this SDK version.



36
37
38
# File 'lib/worldline/acquiring/sdk/communication/metadata_provider.rb', line 36

def sdk_identifier
  @sdk_identifier
end

#shopping_cart_extensionObject

Returns the value of attribute shopping_cart_extension.



42
43
44
# File 'lib/worldline/acquiring/sdk/communication/metadata_provider.rb', line 42

def shopping_cart_extension
  @shopping_cart_extension
end

Instance Method Details

#from_hash(hash) ⇒ Object

Initializes the ServerMetaInfo object with properties stored in the parameter hash



56
57
58
59
60
61
62
63
# File 'lib/worldline/acquiring/sdk/communication/metadata_provider.rb', line 56

def from_hash(hash)
  super
  @platform_identifier = hash['platformIdentifier'] if hash.has_key? 'platformIdentifier'
  @sdk_identifier = hash['sdkIdentifier'] if hash.has_key? 'sdkIdentifier'
  @sdk_creator = hash['sdkCreator'] if hash.has_key? 'sdkCreator'
  @integrator = hash['integrator'] if hash.has_key? 'integrator'
  @shopping_cart_extension = Worldline::Acquiring::SDK::Domain::ShoppingCartExtension.new_from_hash(hash['shoppingCartExtension']) if hash.has_key? 'shoppingCartExtension'
end

#to_hObject

Returns the values of all attributes as a hash.



45
46
47
48
49
50
51
52
53
# File 'lib/worldline/acquiring/sdk/communication/metadata_provider.rb', line 45

def to_h
  hash = super
  hash['platformIdentifier'] = @platform_identifier unless @platform_identifier.nil?
  hash['sdkIdentifier'] = @sdk_identifier unless @sdk_identifier.nil?
  hash['sdkCreator'] = @sdk_creator unless @sdk_creator.nil?
  hash['integrator'] = @integrator unless @integrator.nil?
  hash['shoppingCartExtension'] = @shopping_cart_extension.to_h unless @shopping_cart_extension.nil?
  hash
end