Class: VaultedBilling::Configuration::GatewayConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/vaulted_billing/configuration.rb

Overview

This class holds default configuration options for a specific gateway in the library.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ GatewayConfiguration

Possible options are:

  • password - The default password for the gateway.

  • test_mode - A boolean indicating whether or not to use the test mode of the gateway (sandbox server, test API, etc.)

  • username - The default username for the gateway.

Unless otherwise defined, test_mode will default to being true.

Yields:

  • (_self)

Yield Parameters:



26
27
28
29
30
31
32
33
34
# File 'lib/vaulted_billing/configuration.rb', line 26

def initialize(options = {}, &block)
  options = options.with_indifferent_access
  self.username = options[:username]
  self.password = options[:password]
  self.raw_options = options[:raw_options]
  self.test_mode = options.has_key?(:test_mode) ?
    options[:test_mode] : true
  yield(self) if block_given?
end

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



15
16
17
# File 'lib/vaulted_billing/configuration.rb', line 15

def password
  @password
end

#raw_optionsObject

Returns the value of attribute raw_options.



15
16
17
# File 'lib/vaulted_billing/configuration.rb', line 15

def raw_options
  @raw_options
end

#test_modeObject

Returns the value of attribute test_mode.



15
16
17
# File 'lib/vaulted_billing/configuration.rb', line 15

def test_mode
  @test_mode
end

#usernameObject

Returns the value of attribute username.



15
16
17
# File 'lib/vaulted_billing/configuration.rb', line 15

def username
  @username
end