easypost 4.8.1 → 4.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +5 -0
- data/.github/workflows/ci.yml +8 -0
- data/.gitignore +10 -14
- data/CHANGELOG.md +12 -0
- data/Makefile +10 -2
- data/README.md +7 -3
- data/VERSION +1 -1
- data/docs/EasyPost/Address.html +222 -0
- data/docs/EasyPost/ApiKey.html +99 -0
- data/docs/EasyPost/Batch.html +269 -0
- data/docs/EasyPost/Beta/EndShipper.html +225 -0
- data/docs/EasyPost/Beta/Referral.html +338 -0
- data/docs/EasyPost/Beta.html +91 -0
- data/docs/EasyPost/Billing.html +253 -0
- data/docs/EasyPost/Brand.html +140 -0
- data/docs/EasyPost/CarbonOffset.html +99 -0
- data/docs/EasyPost/CarrierAccount.html +136 -0
- data/docs/EasyPost/CarrierType.html +99 -0
- data/docs/EasyPost/CustomsInfo.html +136 -0
- data/docs/EasyPost/CustomsItem.html +136 -0
- data/docs/EasyPost/EasyPostObject.html +662 -0
- data/docs/EasyPost/EndShipper.html +175 -0
- data/docs/EasyPost/Error.html +258 -0
- data/docs/EasyPost/Event.html +136 -0
- data/docs/EasyPost/Insurance.html +99 -0
- data/docs/EasyPost/Order.html +222 -0
- data/docs/EasyPost/Parcel.html +136 -0
- data/docs/EasyPost/PaymentMethod.html +137 -0
- data/docs/EasyPost/Pickup.html +222 -0
- data/docs/EasyPost/PickupRate.html +99 -0
- data/docs/EasyPost/PostageLabel.html +99 -0
- data/docs/EasyPost/Rate.html +136 -0
- data/docs/EasyPost/Referral.html +334 -0
- data/docs/EasyPost/Refund.html +99 -0
- data/docs/EasyPost/Report.html +167 -0
- data/docs/EasyPost/Resource.html +399 -0
- data/docs/EasyPost/ScanForm.html +137 -0
- data/docs/EasyPost/Shipment.html +456 -0
- data/docs/EasyPost/TaxIdentifier.html +99 -0
- data/docs/EasyPost/Tracker.html +139 -0
- data/docs/EasyPost/User.html +307 -0
- data/docs/EasyPost/Util.html +462 -0
- data/docs/EasyPost/Webhook.html +221 -0
- data/docs/EasyPost.html +440 -0
- data/docs/created.rid +40 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +639 -0
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +117 -0
- data/docs/js/darkfish.js +84 -0
- data/docs/js/navigation.js +105 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +110 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/table_of_contents.html +785 -0
- data/easypost.gemspec +3 -1
- data/lib/easypost/beta/payment_refund.rb +5 -0
- data/lib/easypost/beta/referral.rb +52 -4
- data/lib/easypost/carrier_account.rb +17 -0
- data/lib/easypost/payment_method.rb +2 -1
- data/lib/easypost/referral.rb +4 -4
- data/lib/easypost/shipment.rb +1 -1
- data/lib/easypost/user.rb +5 -2
- data/lib/easypost/util.rb +21 -12
- metadata +117 -11
- data/CODE_OF_CONDUCT.md +0 -16
- data/CONTRIBUTING.md +0 -47
- data/SECURITY.md +0 -7
- data/SUPPORT.md +0 -3
@@ -0,0 +1,139 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class EasyPost::Tracker - EasyPost Ruby Docs</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link"><a href="Resource.html">EasyPost::Resource</a>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
<li ><a href="#method-c-create_list">::create_list</a>
|
76
|
+
</ul>
|
77
|
+
</div>
|
78
|
+
|
79
|
+
</div>
|
80
|
+
</nav>
|
81
|
+
|
82
|
+
<main role="main" aria-labelledby="class-EasyPost::Tracker">
|
83
|
+
<h1 id="class-EasyPost::Tracker" class="class">
|
84
|
+
class EasyPost::Tracker
|
85
|
+
</h1>
|
86
|
+
|
87
|
+
<section class="description">
|
88
|
+
|
89
|
+
<p>A <a href="Tracker.html"><code>Tracker</code></a> object contains all of the tracking information for a package.</p>
|
90
|
+
|
91
|
+
</section>
|
92
|
+
|
93
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
100
|
+
<header>
|
101
|
+
<h3>Public Class Methods</h3>
|
102
|
+
</header>
|
103
|
+
|
104
|
+
<div id="method-c-create_list" class="method-detail ">
|
105
|
+
<div class="method-heading">
|
106
|
+
<span class="method-name">create_list</span><span
|
107
|
+
class="method-args">(params = {}, api_key = nil)</span>
|
108
|
+
<span class="method-click-advice">click to toggle source</span>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<div class="method-description">
|
112
|
+
<p>Create multiple <a href="Tracker.html"><code>Tracker</code></a> objects in bulk.</p>
|
113
|
+
|
114
|
+
<div class="method-source-code" id="create_list-source">
|
115
|
+
<pre><span class="ruby-comment"># File lib/easypost/tracker.rb, line 6</span>
|
116
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">create_list</span>(<span class="ruby-identifier">params</span> = {}, <span class="ruby-identifier">api_key</span> = <span class="ruby-keyword">nil</span>)
|
117
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-node">"#{self.url}/create_list"</span>
|
118
|
+
<span class="ruby-identifier">new_params</span> = { <span class="ruby-string">'trackers'</span> <span class="ruby-operator">=></span> <span class="ruby-identifier">params</span> }
|
119
|
+
<span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:post</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">api_key</span>, <span class="ruby-identifier">new_params</span>)
|
120
|
+
<span class="ruby-keyword">true</span> <span class="ruby-comment"># This endpoint does not return a response so we return true here instead</span>
|
121
|
+
<span class="ruby-keyword">end</span></pre>
|
122
|
+
</div>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
|
128
|
+
</section>
|
129
|
+
|
130
|
+
</section>
|
131
|
+
</main>
|
132
|
+
|
133
|
+
|
134
|
+
<footer id="validator-badges" role="contentinfo">
|
135
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
136
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
137
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
138
|
+
</footer>
|
139
|
+
|
@@ -0,0 +1,307 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>class EasyPost::User - EasyPost Ruby Docs</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../";
|
11
|
+
var index_rel_prefix = "../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../js/navigation.js" defer></script>
|
15
|
+
<script src="../js/search.js" defer></script>
|
16
|
+
<script src="../js/search_index.js" defer></script>
|
17
|
+
<script src="../js/searcher.js" defer></script>
|
18
|
+
<script src="../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="class">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="class-metadata">
|
59
|
+
|
60
|
+
|
61
|
+
<div id="parent-class-section" class="nav-section">
|
62
|
+
<h3>Parent</h3>
|
63
|
+
|
64
|
+
<p class="link"><a href="Resource.html">EasyPost::Resource</a>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
<!-- Method Quickref -->
|
71
|
+
<div id="method-list-section" class="nav-section">
|
72
|
+
<h3>Methods</h3>
|
73
|
+
|
74
|
+
<ul class="link-list" role="directory">
|
75
|
+
<li ><a href="#method-c-all_api_keys">::all_api_keys</a>
|
76
|
+
<li ><a href="#method-c-create">::create</a>
|
77
|
+
<li ><a href="#method-c-retrieve_me">::retrieve_me</a>
|
78
|
+
<li ><a href="#method-i-api_keys">#api_keys</a>
|
79
|
+
<li ><a href="#method-i-delete">#delete</a>
|
80
|
+
<li ><a href="#method-i-save">#save</a>
|
81
|
+
<li ><a href="#method-i-update_brand">#update_brand</a>
|
82
|
+
</ul>
|
83
|
+
</div>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
</nav>
|
87
|
+
|
88
|
+
<main role="main" aria-labelledby="class-EasyPost::User">
|
89
|
+
<h1 id="class-EasyPost::User" class="class">
|
90
|
+
class EasyPost::User
|
91
|
+
</h1>
|
92
|
+
|
93
|
+
<section class="description">
|
94
|
+
|
95
|
+
<p>The <a href="User.html"><code>User</code></a> object can be used to manage your own account and to create child accounts.</p>
|
96
|
+
|
97
|
+
</section>
|
98
|
+
|
99
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
106
|
+
<header>
|
107
|
+
<h3>Public Class Methods</h3>
|
108
|
+
</header>
|
109
|
+
|
110
|
+
<div id="method-c-all_api_keys" class="method-detail ">
|
111
|
+
<div class="method-heading">
|
112
|
+
<span class="method-name">all_api_keys</span><span
|
113
|
+
class="method-args">()</span>
|
114
|
+
<span class="method-click-advice">click to toggle source</span>
|
115
|
+
</div>
|
116
|
+
|
117
|
+
<div class="method-description">
|
118
|
+
<p>Retrieve a list of ApiKey objects.</p>
|
119
|
+
|
120
|
+
<div class="method-source-code" id="all_api_keys-source">
|
121
|
+
<pre><span class="ruby-comment"># File lib/easypost/user.rb, line 37</span>
|
122
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">all_api_keys</span>
|
123
|
+
<span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">ApiKey</span>.<span class="ruby-identifier">all</span>
|
124
|
+
<span class="ruby-keyword">end</span></pre>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<div id="method-c-create" class="method-detail ">
|
132
|
+
<div class="method-heading">
|
133
|
+
<span class="method-name">create</span><span
|
134
|
+
class="method-args">(params = {}, api_key = nil)</span>
|
135
|
+
<span class="method-click-advice">click to toggle source</span>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
<div class="method-description">
|
139
|
+
<p>Create a child <a href="User.html"><code>User</code></a>.</p>
|
140
|
+
|
141
|
+
<div class="method-source-code" id="create-source">
|
142
|
+
<pre><span class="ruby-comment"># File lib/easypost/user.rb, line 6</span>
|
143
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">create</span>(<span class="ruby-identifier">params</span> = {}, <span class="ruby-identifier">api_key</span> = <span class="ruby-keyword">nil</span>)
|
144
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:post</span>, <span class="ruby-identifier">url</span>, <span class="ruby-identifier">api_key</span>, { <span class="ruby-identifier">class_name</span>.<span class="ruby-identifier">to_sym</span> <span class="ruby-operator">=></span> <span class="ruby-identifier">params</span> })
|
145
|
+
<span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">convert_to_easypost_object</span>(<span class="ruby-identifier">response</span>, <span class="ruby-identifier">api_key</span>)
|
146
|
+
<span class="ruby-keyword">end</span></pre>
|
147
|
+
</div>
|
148
|
+
</div>
|
149
|
+
|
150
|
+
|
151
|
+
</div>
|
152
|
+
|
153
|
+
<div id="method-c-retrieve_me" class="method-detail ">
|
154
|
+
<div class="method-heading">
|
155
|
+
<span class="method-name">retrieve_me</span><span
|
156
|
+
class="method-args">()</span>
|
157
|
+
<span class="method-click-advice">click to toggle source</span>
|
158
|
+
</div>
|
159
|
+
|
160
|
+
<div class="method-description">
|
161
|
+
<p>Retrieve the authenticated <a href="User.html"><code>User</code></a>.</p>
|
162
|
+
|
163
|
+
<div class="method-source-code" id="retrieve_me-source">
|
164
|
+
<pre><span class="ruby-comment"># File lib/easypost/user.rb, line 32</span>
|
165
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">retrieve_me</span>
|
166
|
+
<span class="ruby-identifier">all</span>
|
167
|
+
<span class="ruby-keyword">end</span></pre>
|
168
|
+
</div>
|
169
|
+
</div>
|
170
|
+
|
171
|
+
|
172
|
+
</div>
|
173
|
+
|
174
|
+
</section>
|
175
|
+
|
176
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
177
|
+
<header>
|
178
|
+
<h3>Public Instance Methods</h3>
|
179
|
+
</header>
|
180
|
+
|
181
|
+
<div id="method-i-api_keys" class="method-detail ">
|
182
|
+
<div class="method-heading">
|
183
|
+
<span class="method-name">api_keys</span><span
|
184
|
+
class="method-args">()</span>
|
185
|
+
<span class="method-click-advice">click to toggle source</span>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div class="method-description">
|
189
|
+
<p>Retrieve a list of ApiKey objects of a child <a href="User.html"><code>User</code></a>.</p>
|
190
|
+
|
191
|
+
<div class="method-source-code" id="api_keys-source">
|
192
|
+
<pre><span class="ruby-comment"># File lib/easypost/user.rb, line 42</span>
|
193
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">api_keys</span>
|
194
|
+
<span class="ruby-identifier">api_keys</span> = <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">User</span>.<span class="ruby-identifier">all_api_keys</span>
|
195
|
+
|
196
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">api_keys</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span>
|
197
|
+
<span class="ruby-identifier">my_api_keys</span> = <span class="ruby-identifier">api_keys</span>.<span class="ruby-identifier">keys</span>
|
198
|
+
<span class="ruby-keyword">else</span>
|
199
|
+
<span class="ruby-identifier">api_keys</span>.<span class="ruby-identifier">children</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">child</span><span class="ruby-operator">|</span>
|
200
|
+
<span class="ruby-keyword">if</span> <span class="ruby-identifier">child</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span>
|
201
|
+
<span class="ruby-identifier">my_api_keys</span> = <span class="ruby-identifier">child</span>.<span class="ruby-identifier">keys</span>
|
202
|
+
<span class="ruby-keyword">break</span>
|
203
|
+
<span class="ruby-keyword">end</span>
|
204
|
+
<span class="ruby-keyword">end</span>
|
205
|
+
<span class="ruby-keyword">end</span>
|
206
|
+
|
207
|
+
<span class="ruby-identifier">my_api_keys</span>
|
208
|
+
<span class="ruby-keyword">end</span></pre>
|
209
|
+
</div>
|
210
|
+
</div>
|
211
|
+
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
<div id="method-i-delete" class="method-detail ">
|
216
|
+
<div class="method-heading">
|
217
|
+
<span class="method-name">delete</span><span
|
218
|
+
class="method-args">()</span>
|
219
|
+
<span class="method-click-advice">click to toggle source</span>
|
220
|
+
</div>
|
221
|
+
|
222
|
+
<div class="method-description">
|
223
|
+
<p>Delete a <a href="User.html"><code>User</code></a>.</p>
|
224
|
+
|
225
|
+
<div class="method-source-code" id="delete-source">
|
226
|
+
<pre><span class="ruby-comment"># File lib/easypost/user.rb, line 26</span>
|
227
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete</span>
|
228
|
+
<span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:delete</span>, <span class="ruby-identifier">url</span>, <span class="ruby-ivar">@api_key</span>)
|
229
|
+
<span class="ruby-keyword">self</span>
|
230
|
+
<span class="ruby-keyword">end</span></pre>
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<div id="method-i-save" class="method-detail ">
|
238
|
+
<div class="method-heading">
|
239
|
+
<span class="method-name">save</span><span
|
240
|
+
class="method-args">()</span>
|
241
|
+
<span class="method-click-advice">click to toggle source</span>
|
242
|
+
</div>
|
243
|
+
|
244
|
+
<div class="method-description">
|
245
|
+
<p>Save (update) a <a href="User.html"><code>User</code></a>.</p>
|
246
|
+
|
247
|
+
<div class="method-source-code" id="save-source">
|
248
|
+
<pre><span class="ruby-comment"># File lib/easypost/user.rb, line 12</span>
|
249
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">save</span>
|
250
|
+
<span class="ruby-keyword">if</span> <span class="ruby-ivar">@unsaved_values</span>.<span class="ruby-identifier">length</span>.<span class="ruby-identifier">positive?</span>
|
251
|
+
<span class="ruby-identifier">values</span> = {}
|
252
|
+
<span class="ruby-ivar">@unsaved_values</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">values</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-ivar">@values</span>[<span class="ruby-identifier">k</span>] }
|
253
|
+
|
254
|
+
<span class="ruby-identifier">wrapped_params</span> = { <span class="ruby-value">user:</span> <span class="ruby-identifier">values</span> }
|
255
|
+
|
256
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-constant">EasyPost</span>.<span class="ruby-identifier">make_request</span>(<span class="ruby-value">:patch</span>, <span class="ruby-identifier">url</span>, <span class="ruby-ivar">@api_key</span>, <span class="ruby-identifier">wrapped_params</span>)
|
257
|
+
<span class="ruby-identifier">refresh_from</span>(<span class="ruby-identifier">response</span>, <span class="ruby-identifier">api_key</span>)
|
258
|
+
<span class="ruby-keyword">end</span>
|
259
|
+
<span class="ruby-keyword">self</span>
|
260
|
+
<span class="ruby-keyword">end</span></pre>
|
261
|
+
</div>
|
262
|
+
</div>
|
263
|
+
|
264
|
+
|
265
|
+
</div>
|
266
|
+
|
267
|
+
<div id="method-i-update_brand" class="method-detail ">
|
268
|
+
<div class="method-heading">
|
269
|
+
<span class="method-name">update_brand</span><span
|
270
|
+
class="method-args">(**attrs)</span>
|
271
|
+
<span class="method-click-advice">click to toggle source</span>
|
272
|
+
</div>
|
273
|
+
|
274
|
+
<div class="method-description">
|
275
|
+
<p>Update the Brand of a <a href="User.html"><code>User</code></a>.</p>
|
276
|
+
|
277
|
+
<div class="method-source-code" id="update_brand-source">
|
278
|
+
<pre><span class="ruby-comment"># File lib/easypost/user.rb, line 60</span>
|
279
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">update_brand</span>(<span class="ruby-operator">**</span><span class="ruby-identifier">attrs</span>)
|
280
|
+
<span class="ruby-identifier">brand</span> = <span class="ruby-constant">EasyPost</span><span class="ruby-operator">::</span><span class="ruby-constant">Brand</span>.<span class="ruby-identifier">new</span>
|
281
|
+
<span class="ruby-identifier">data</span> = { <span class="ruby-value">object:</span> <span class="ruby-string">'Brand'</span>, <span class="ruby-value">user_id:</span> <span class="ruby-identifier">id</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">attrs</span> }
|
282
|
+
<span class="ruby-comment"># Add accessors manually because there's no API to retrieve a brand</span>
|
283
|
+
<span class="ruby-identifier">brand</span>.<span class="ruby-identifier">add_accessors</span>(<span class="ruby-identifier">data</span>.<span class="ruby-identifier">keys</span>)
|
284
|
+
<span class="ruby-comment"># Assigning values with accessors defined above</span>
|
285
|
+
<span class="ruby-identifier">data</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
286
|
+
<span class="ruby-identifier">brand</span>.<span class="ruby-identifier">send</span>(<span class="ruby-node">"#{key}="</span>, <span class="ruby-identifier">val</span>)
|
287
|
+
<span class="ruby-keyword">end</span>
|
288
|
+
<span class="ruby-identifier">brand</span>.<span class="ruby-identifier">save</span>
|
289
|
+
<span class="ruby-keyword">end</span></pre>
|
290
|
+
</div>
|
291
|
+
</div>
|
292
|
+
|
293
|
+
|
294
|
+
</div>
|
295
|
+
|
296
|
+
</section>
|
297
|
+
|
298
|
+
</section>
|
299
|
+
</main>
|
300
|
+
|
301
|
+
|
302
|
+
<footer id="validator-badges" role="contentinfo">
|
303
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
304
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.
|
305
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
306
|
+
</footer>
|
307
|
+
|