Module: USPS

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

Defined Under Namespace

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

Constant Summary collapse

VERSION =
'0.1.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject



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

def config
  @config ||= Configuration.new
end

Class Method Details

.clientObject



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

def client
  @client ||= Client.new
end

.configure(&block) ⇒ Object



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

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

.get_city_and_state_for_zip(zip) ⇒ Object



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

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

.testing=(val) ⇒ Object



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

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

.usernameObject



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

def username
  config.username
end

.username=(user) ⇒ Object

These two methods are currently here for backwards compatability



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

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