Class: Ingenico::Direct::SDK::MetaDataProvider::ServerMetaInfo

Inherits:
DataObject
  • Object
show all
Defined in:
lib/ingenico/direct/sdk/meta_data_provider.rb

Overview

Stores metadata about the server so it can be sent to the Ingenico ePayments platform

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#integratorObject

Returns the value of attribute integrator.



32
33
34
# File 'lib/ingenico/direct/sdk/meta_data_provider.rb', line 32

def integrator
  @integrator
end

#platform_identifierObject

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



25
26
27
# File 'lib/ingenico/direct/sdk/meta_data_provider.rb', line 25

def platform_identifier
  @platform_identifier
end

#sdk_creatorObject

Returns the value of attribute sdk_creator.



30
31
32
# File 'lib/ingenico/direct/sdk/meta_data_provider.rb', line 30

def sdk_creator
  @sdk_creator
end

#sdk_identifierObject

String containing this SDK version.



28
29
30
# File 'lib/ingenico/direct/sdk/meta_data_provider.rb', line 28

def sdk_identifier
  @sdk_identifier
end

#shopping_cart_extensionObject

Returns the value of attribute shopping_cart_extension.



34
35
36
# File 'lib/ingenico/direct/sdk/meta_data_provider.rb', line 34

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



48
49
50
51
52
53
54
55
# File 'lib/ingenico/direct/sdk/meta_data_provider.rb', line 48

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 = Domain::ShoppingCartExtension.new_from_hash(hash['shoppingCartExtension']) if hash.has_key? 'shoppingCartExtension'
end

#to_hObject

Returns the values of all attributes as a hash.



37
38
39
40
41
42
43
44
45
# File 'lib/ingenico/direct/sdk/meta_data_provider.rb', line 37

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