Class: G4s
- Inherits:
-
Object
- Object
- G4s
- Defined in:
- lib/g4s/g4s.rb
Defined Under Namespace
Constant Summary collapse
- CONFIG =
YAML.load( ENV['G4S_CONFIG'] || File.read(Rails.root + 'config' + 'g4s.yml') )
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ G4s
constructor
A new instance of G4s.
- #shipping ⇒ Object
- #tracking ⇒ Object
- #utilities ⇒ Object
Constructor Details
#initialize ⇒ G4s
Returns a new instance of G4s.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/g4s/g4s.rb', line 14 def initialize if g4s_env == ::G4s::TEST @shipping_class = ::G4sClient::ShippingTest @utilities_class = ::G4sClient::UtilitiesTest @tracking_class = ::G4sClient::TrackingTest else @shipping_class = ::G4sClient::ShippingLive @utilities_class = ::G4sClient::UtilitiesLive @tracking_class = ::G4sClient::TrackingLive end end |
Class Method Details
.instance ⇒ Object
10 11 12 |
# File 'lib/g4s/g4s.rb', line 10 def self.instance @@instance ||= self.new end |
Instance Method Details
#shipping ⇒ Object
26 27 28 |
# File 'lib/g4s/g4s.rb', line 26 def shipping @shipping_class.new # do not cache these between requests! need to clear-out headers! end |
#tracking ⇒ Object
32 33 34 |
# File 'lib/g4s/g4s.rb', line 32 def tracking @tracking_class.new end |
#utilities ⇒ Object
29 30 31 |
# File 'lib/g4s/g4s.rb', line 29 def utilities @utilities_class.new end |