Class: EasyPost::Refund

Inherits:
Resource show all
Defined in:
lib/easypost/refund.rb

Overview

The Refund object contains details about the Refund of a Shipment.

Instance Attribute Summary

Attributes inherited from EasyPostObject

#api_key, #name, #parent, #unsaved_values

Class Method Summary collapse

Methods inherited from Resource

all, class_name, create, #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.



11
12
13
14
15
16
17
18
# File 'lib/easypost/refund.rb', line 11

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

.get_next_page(collection, page_size = nil) ⇒ Object

Get the next page of refunds.



6
7
8
# File 'lib/easypost/refund.rb', line 6

def self.get_next_page(collection, page_size = nil)
  get_next_page_exec(method(:all), collection, collection.refunds, page_size)
end