Class: EasyPost::ScanForm
- Inherits:
-
Resource
- Object
- EasyPostObject
- Resource
- EasyPost::ScanForm
- Defined in:
- lib/easypost/scan_form.rb
Overview
A ScanForm can be created to speed up and simplify the carrier pickup process. The ScanForm is one document that can be scanned to mark all included tracking codes as “Accepted for Shipment” by the carrier.
Instance Attribute Summary
Attributes inherited from EasyPostObject
#api_key, #name, #parent, #unsaved_values
Class Method Summary collapse
-
.build_next_page_params(_collection, current_page_items, page_size = nil) ⇒ Object
Build the next page parameters.
-
.create(params = {}, api_key = nil) ⇒ Object
Create a ScanForm.
-
.get_next_page(collection, page_size = nil) ⇒ Object
Get the next page of scan forms.
Methods inherited from Resource
all, class_name, #delete, each, get_next_page_exec, #refresh, retrieve, #save, url, #url
Methods inherited from EasyPostObject
#[], #[]=, #as_json, construct_from, #deconstruct_keys, #each, #id, #id=, #initialize, #inspect, #keys, #refresh_from, #to_hash, #to_json, #to_s, #values
Constructor Details
This class inherits a constructor from EasyPost::EasyPostObject
Class Method Details
.build_next_page_params(_collection, current_page_items, page_size = nil) ⇒ Object
Build the next page parameters.
18 19 20 21 22 23 24 25 |
# File 'lib/easypost/scan_form.rb', line 18 def self.build_next_page_params(_collection, current_page_items, page_size = nil) params = {} params[:before_id] = current_page_items.last.id unless page_size.nil? params[:page_size] = page_size end params end |
.create(params = {}, api_key = nil) ⇒ Object
Create a ScanForm.
7 8 9 10 |
# File 'lib/easypost/scan_form.rb', line 7 def self.create(params = {}, api_key = nil) response = EasyPost.make_request(:post, url, api_key, params) EasyPost::Util.convert_to_easypost_object(response, api_key) end |
.get_next_page(collection, page_size = nil) ⇒ Object
Get the next page of scan forms.
13 14 15 |
# File 'lib/easypost/scan_form.rb', line 13 def self.get_next_page(collection, page_size = nil) get_next_page_exec(method(:all), collection, collection.scan_forms, page_size) end |