Class: ProcessOut::GatewayConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/processout/gateway_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, data = {}) ⇒ GatewayConfiguration

Initializes the GatewayConfiguration object Params:

client

ProcessOut client instance

data

data that can be used to fill the object



56
57
58
59
60
61
62
63
64
65
# File 'lib/processout/gateway_configuration.rb', line 56

def initialize(client, data = {})
  @client = client

  @id = data.fetch(:id, "")
  @project = data.fetch(:project, nil)
  @gateway = data.fetch(:gateway, nil)
  @enabled = data.fetch(:enabled, false)
  @public_keys = data.fetch(:public_keys, Hash.new)
  
end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled.



13
14
15
# File 'lib/processout/gateway_configuration.rb', line 13

def enabled
  @enabled
end

#gatewayObject

Returns the value of attribute gateway.



12
13
14
# File 'lib/processout/gateway_configuration.rb', line 12

def gateway
  @gateway
end

#idObject

Returns the value of attribute id.



10
11
12
# File 'lib/processout/gateway_configuration.rb', line 10

def id
  @id
end

#projectObject

Returns the value of attribute project.



11
12
13
# File 'lib/processout/gateway_configuration.rb', line 11

def project
  @project
end

#public_keysObject

Returns the value of attribute public_keys.



14
15
16
# File 'lib/processout/gateway_configuration.rb', line 14

def public_keys
  @public_keys
end

Instance Method Details

#fill_with_data(data) ⇒ Object

Fills the object with data coming from the API Params:

data

Hash of data coming from the API



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/processout/gateway_configuration.rb', line 75

def fill_with_data(data)
  if data.include? "id"
    self.id = data["id"]
  end
  if data.include? "project"
    self.project = data["project"]
  end
  if data.include? "gateway"
    self.gateway = data["gateway"]
  end
  if data.include? "enabled"
    self.enabled = data["enabled"]
  end
  if data.include? "public_keys"
    self.public_keys = data["public_keys"]
  end
  
  self
end

#new(data = {}) ⇒ Object

Create a new GatewayConfiguration using the current client



68
69
70
# File 'lib/processout/gateway_configuration.rb', line 68

def new(data = {})
  GatewayConfiguration.new(@client, data)
end