Module: USPS

Defined in:
lib/usps.rb,
lib/usps/test.rb,
lib/usps/client.rb,
lib/usps/errors.rb,
lib/usps/configuration.rb

Defined Under Namespace

Modules: Request, Response Classes: Address, AddressNotFoundError, AuthorizationError, Client, Configuration, Error, InvalidCityError, InvalidImageTypeError, InvalidStateError, MultipleAddressError, Test, ValidationError

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject



24
25
26
# File 'lib/usps.rb', line 24

def config
  @config ||= Configuration.new
end

Class Method Details

.clientObject



16
17
18
# File 'lib/usps.rb', line 16

def client
  @client ||= Client.new
end

.configure(&block) ⇒ Object



28
29
30
# File 'lib/usps.rb', line 28

def configure(&block)
  block.call(self.config)
end

.get_city_and_state_for_zip(zip) ⇒ Object



41
42
43
# File 'lib/usps.rb', line 41

def get_city_and_state_for_zip(zip)
  USPS::Request::CityAndStateLookup.new(zip).send!.get(zip)
end

.testing=(val) ⇒ Object



20
21
22
# File 'lib/usps.rb', line 20

def testing=(val)
  config.testing = val
end

.usernameObject



37
38
39
# File 'lib/usps.rb', line 37

def username
  config.username
end

.username=(user) ⇒ Object

These two methods are currently here for backwards compatability



33
34
35
# File 'lib/usps.rb', line 33

def username=(user)
  config.username = user
end