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) ⇒ GatewayConfiguration

Initializes the GatewayConfiguration object Params:

client

ProcessOut client instance



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

def initialize(client)
  @client = client

  @id = ""
  @project = nil
  @gateway = nil
  @enabled = false
  @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



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/processout/gateway_configuration.rb', line 69

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