Class: FlexOps::Resources::Offsets
- Inherits:
-
Object
- Object
- FlexOps::Resources::Offsets
- Defined in:
- lib/flexops/resources/offsets.rb
Instance Method Summary collapse
- #batch_offset(label_ids) ⇒ Object
- #get_emissions(label_id) ⇒ Object
-
#initialize(http, ws_id_proc) ⇒ Offsets
constructor
A new instance of Offsets.
- #offset(label_id) ⇒ Object
Constructor Details
#initialize(http, ws_id_proc) ⇒ Offsets
Returns a new instance of Offsets.
14 15 16 17 |
# File 'lib/flexops/resources/offsets.rb', line 14 def initialize(http, ws_id_proc) @http = http @ws_id = ws_id_proc end |
Instance Method Details
#batch_offset(label_ids) ⇒ Object
27 28 29 |
# File 'lib/flexops/resources/offsets.rb', line 27 def batch_offset(label_ids) @http.post("#{ws_path}/shipping/labels/offset/batch", body: { labelIds: label_ids }) end |
#get_emissions(label_id) ⇒ Object
23 24 25 |
# File 'lib/flexops/resources/offsets.rb', line 23 def get_emissions(label_id) @http.get("#{ws_path}/shipping/labels/#{label_id}/emissions") end |
#offset(label_id) ⇒ Object
19 20 21 |
# File 'lib/flexops/resources/offsets.rb', line 19 def offset(label_id) @http.post("#{ws_path}/shipping/labels/#{label_id}/offset") end |