Class: USPS::Configuration

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

Overview

Configuration options:

username: Provided by the USPS during registration
timeout: Connection timeout in milliseconds, nil to disable
testing: Should requests be done against the testing service or not
         (only specific requests are supported).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



8
9
10
11
12
13
# File 'lib/usps/configuration.rb', line 8

def initialize
  self.timeout  = 5
  self.testing  = false
  self.username = ENV['USPS_USER']
  self.proxy = nil
end

Instance Attribute Details

#proxyObject

Returns the value of attribute proxy

Returns:

  • (Object)

    the current value of proxy



7
8
9
# File 'lib/usps/configuration.rb', line 7

def proxy
  @proxy
end

#testingObject Also known as: testing?

Returns the value of attribute testing

Returns:

  • (Object)

    the current value of testing



7
8
9
# File 'lib/usps/configuration.rb', line 7

def testing
  @testing
end

#timeoutObject

Returns the value of attribute timeout

Returns:

  • (Object)

    the current value of timeout



7
8
9
# File 'lib/usps/configuration.rb', line 7

def timeout
  @timeout
end

#usernameObject

Returns the value of attribute username

Returns:

  • (Object)

    the current value of username



7
8
9
# File 'lib/usps/configuration.rb', line 7

def username
  @username
end