Class: Workarea::BogusCarrier
- Inherits:
-
ActiveShipping::Workarea
- Object
- ActiveShipping::Carrier
- ActiveShipping::Workarea
- Workarea::BogusCarrier
- Defined in:
- lib/workarea/bogus_carrier.rb
Constant Summary collapse
- MESSAGE =
'SUCCESS - 0000 Success'
Instance Method Summary collapse
- #create_shipment(origin, destination, packages, options = {}) ⇒ Object
- #generate_tracking_number ⇒ Object
- #image ⇒ Object
Methods inherited from ActiveShipping::Workarea
Instance Method Details
#create_shipment(origin, destination, packages, options = {}) ⇒ Object
5 6 7 8 |
# File 'lib/workarea/bogus_carrier.rb', line 5 def create_shipment(origin, destination, packages, = {}) labels = [ActiveShipping::Label.new(generate_tracking_number, image)] ActiveShipping::LabelResponse.new(true, MESSAGE, {}, labels: labels) end |
#generate_tracking_number ⇒ Object
10 11 12 |
# File 'lib/workarea/bogus_carrier.rb', line 10 def generate_tracking_number "1ZX1A#{Array.new(13) { rand(0..9) }.join}" end |