Class: ProcessOut::GatewayConfiguration
- Inherits:
-
Object
- Object
- ProcessOut::GatewayConfiguration
- Defined in:
- lib/processout/gateway_configuration.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#gateway ⇒ Object
Returns the value of attribute gateway.
-
#id ⇒ Object
Returns the value of attribute id.
-
#project ⇒ Object
Returns the value of attribute project.
-
#public_keys ⇒ Object
Returns the value of attribute public_keys.
Instance Method Summary collapse
-
#fill_with_data(data) ⇒ Object
- Fills the object with data coming from the API Params:
data -
Hashof data coming from the API.
- Fills the object with data coming from the API Params:
-
#initialize(client, data = {}) ⇒ GatewayConfiguration
constructor
- Initializes the GatewayConfiguration object Params:
client ProcessOutclient instancedata-
data that can be used to fill the object.
- Initializes the GatewayConfiguration object Params:
-
#new(data = {}) ⇒ Object
Create a new GatewayConfiguration using the current client.
-
#prefill(data) ⇒ Object
- Prefills the object with the data passed as parameters Params:
data -
Hashof data.
- Prefills the object with the data passed as parameters Params:
Constructor Details
#initialize(client, data = {}) ⇒ GatewayConfiguration
Initializes the GatewayConfiguration object Params:
client-
ProcessOutclient 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 self.id = data.fetch(:id, nil) self.project = data.fetch(:project, nil) self.gateway = data.fetch(:gateway, nil) self.enabled = data.fetch(:enabled, nil) self.public_keys = data.fetch(:public_keys, nil) end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
13 14 15 |
# File 'lib/processout/gateway_configuration.rb', line 13 def enabled @enabled end |
#gateway ⇒ Object
Returns the value of attribute gateway.
12 13 14 |
# File 'lib/processout/gateway_configuration.rb', line 12 def gateway @gateway end |
#id ⇒ Object
Returns the value of attribute id.
10 11 12 |
# File 'lib/processout/gateway_configuration.rb', line 10 def id @id end |
#project ⇒ Object
Returns the value of attribute project.
11 12 13 |
# File 'lib/processout/gateway_configuration.rb', line 11 def project @project end |
#public_keys ⇒ Object
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-
Hashof data coming from the API
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/processout/gateway_configuration.rb', line 75 def fill_with_data(data) if data.nil? return self end 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 |
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
data-
Hashof data
101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/processout/gateway_configuration.rb', line 101 def prefill(data) if data.nil? return self end self.id = data.fetch(:id, self.id) self.project = data.fetch(:project, self.project) self.gateway = data.fetch(:gateway, self.gateway) self.enabled = data.fetch(:enabled, self.enabled) self.public_keys = data.fetch(:public_keys, self.public_keys) self end |