Sha256: c432a248cf274d8009f795faac4e52560fcc521d27376e8e7bebc70d5d10a7cc
Contents?: true
Size: 1.58 KB
Versions: 62
Compression:
Stored size: 1.58 KB
Contents
module ActiveShipping module Carriers extend self attr_reader :registered @registered = [] def register(class_name, autoload_require) ActiveShipping.autoload(class_name, autoload_require) self.registered << class_name end def all ActiveShipping::Carriers.registered.map { |name| ActiveShipping.const_get(name) } end def find(name) all.find { |c| c.name.downcase == name.to_s.downcase } || raise(NameError, "unknown carrier #{name}") end end end ActiveShipping::Carriers.register :BenchmarkCarrier, 'active_shipping/carriers/benchmark_carrier' ActiveShipping::Carriers.register :BogusCarrier, 'active_shipping/carriers/bogus_carrier' ActiveShipping::Carriers.register :USPS, 'active_shipping/carriers/usps' ActiveShipping::Carriers.register :USPSReturns, 'active_shipping/carriers/usps_returns' ActiveShipping::Carriers.register :FedEx, 'active_shipping/carriers/fedex' ActiveShipping::Carriers.register :Shipwire, 'active_shipping/carriers/shipwire' ActiveShipping::Carriers.register :Kunaki, 'active_shipping/carriers/kunaki' ActiveShipping::Carriers.register :CanadaPost, 'active_shipping/carriers/canada_post' ActiveShipping::Carriers.register :NewZealandPost, 'active_shipping/carriers/new_zealand_post' ActiveShipping::Carriers.register :CanadaPostPWS, 'active_shipping/carriers/canada_post_pws' ActiveShipping::Carriers.register :Stamps, 'active_shipping/carriers/stamps' ActiveShipping::Carriers.register :AustraliaPost, 'active_shipping/carriers/australia_post'
Version data entries
62 entries across 62 versions & 1 rubygems