Class: FlexOps::Resources::Offsets

Inherits:
Object
  • Object
show all
Defined in:
lib/flexops/resources/offsets.rb

Instance Method Summary collapse

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