module Payture::Configuration
Constants
- DEFAULT_ADAPTER
- DEFAULT_API_TYPE
- DEFAULT_FORMAT
- DEFAULT_HOST_TYPE
- DEFAULT_KEY
- DEFAULT_PASSWORD
- DEFAULT_USER_AGENT
- DOMAIN
- VALID_OPTIONS_KEYS
Public Class Methods
extended(base)
click to toggle source
When this module is extended, set all configuration options to their default values
# File lib/payture/configuration.rb, line 31 def self.extended(base) base.reset end
Public Instance Methods
configure() { |self| ... }
click to toggle source
Convenience method to allow configuration options to be set in a block
# File lib/payture/configuration.rb, line 36 def configure yield self end
options()
click to toggle source
Create a hash of options and their values
# File lib/payture/configuration.rb, line 41 def options VALID_OPTIONS_KEYS.inject({}) do |option, key| option.merge!(key => send(key)) end end
reset()
click to toggle source
Reset all configuration options to defaults
# File lib/payture/configuration.rb, line 48 def reset self.adapter = DEFAULT_ADAPTER self.api_type = DEFAULT_API_TYPE self.host_type = DEFAULT_HOST_TYPE self.key = DEFAULT_KEY self.password = DEFAULT_PASSWORD self.user_agent = DEFAULT_USER_AGENT self.format = DEFAULT_FORMAT end