Class: EasyPost::Beta::Rate

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

Overview

A Rate object contains all the details about the rate 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, build_next_page_params, 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

.retrieve_stateless_rates(params = {}, api_key = nil) ⇒ Object

Retrieve a list of stateless rates.



6
7
8
9
10
11
12
13
# File 'lib/easypost/beta/rate.rb', line 6

def self.retrieve_stateless_rates(params = {}, api_key = nil)
  wrapped_params = {
    shipment: params,
  }

  response = EasyPost.make_request(:post, '/beta/rates', api_key, wrapped_params)
  EasyPost::Util.convert_to_easypost_object(response['rates'], api_key)
end