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, TrackDetail, ValidationError

Constant Summary collapse

VERSION =
'0.1.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject



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

def config
  @config ||= Configuration.new
end

Class Method Details

.clientObject



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

def client
  @client ||= Client.new
end

.configure(&block) ⇒ Object



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

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

.get_city_and_state_for_zip(zip) ⇒ Object



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

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

.testing=(val) ⇒ Object



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

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

.usernameObject



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

def username
  config.username
end

.username=(user) ⇒ Object

These two methods are currently here for backwards compatability



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

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