service_client 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef70f71d1ff5daf899d92ef3e56f0b342ab08265725f01dee7b56653a4f3686b
4
- data.tar.gz: d91e2c02bae3a8252dc030aaaacf8f4699f63a1174c5e0addba893f1e1e4f375
3
+ metadata.gz: 83056ee0b53ce4dd289dd6ad8ff474491a7432e146ee64b20cb253ae1f403786
4
+ data.tar.gz: 3a3b5f000c9db7b65f240952ecb079ec02decbad0b29a7e4ed6b70428ac815d8
5
5
  SHA512:
6
- metadata.gz: 644443a0c8e582ac6835aaf8a0842e7963ca751ea11f34c5e1908088b5dc46ec5086d6e2a960c4214454a104422e9a9a7277ef229e3a1baadd6f25d01c51f404
7
- data.tar.gz: 8948d6757a730b924896a666fac5dedb4152a80b7d65f49ddbbeb25137ccfa1a1b722fc412e2925d33f8792346b0c59438b4b853ddb30469acf2e957b6eff6f1
6
+ metadata.gz: 88d8a46deccaeb9f1bd1f730153968e05a99c85c8512b3daf614ec8a8eeb7d66c40583d3a7bc57b74ec8f65a99d430984755ab09b8d04004dc5ffe6f77fdb472
7
+ data.tar.gz: 46e90c9a75e91a530950e8059b3481618a5b59b867ffe8fc37f0b71142e5fade5f81b1317b376d3e1511650c5b47cc1cef1ddac46c3290ec192c2f730f4c6dec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- service_client (0.1.2)
4
+ service_client (0.1.3)
5
5
  httparty (~> 0.18.0)
6
6
 
7
7
  GEM
data/doc/index.html ADDED
@@ -0,0 +1,266 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>
8
+ File: README
9
+
10
+ &mdash; Documentation by YARD 0.9.28
11
+
12
+ </title>
13
+
14
+ <link rel="stylesheet" href="css/style.css" type="text/css" />
15
+
16
+ <link rel="stylesheet" href="css/common.css" type="text/css" />
17
+
18
+ <script type="text/javascript">
19
+ pathId = "README";
20
+ relpath = '';
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+
31
+ <body>
32
+ <div class="nav_wrap">
33
+ <iframe id="nav" src="class_list.html?1"></iframe>
34
+ <div id="resizer"></div>
35
+ </div>
36
+
37
+ <div id="main" tabindex="-1">
38
+ <div id="header">
39
+ <div id="menu">
40
+
41
+ <a href="_index.html">Index</a> &raquo;
42
+ <span class="title">File: README</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link" href="class_list.html">
49
+
50
+ <svg width="24" height="24">
51
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
52
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
54
+ </svg>
55
+ </a>
56
+
57
+ </div>
58
+ <div class="clear"></div>
59
+ </div>
60
+
61
+ <div id="content">
62
+ <div id='filecontents'>
63
+ <h1 id="serviceclient">ServiceClient</h1>
64
+
65
+ <p>Welcome to your new gem! In this directory, you’ll find the files you need to be able to package up your Ruby
66
+ library into a gem. Put your Ruby code in the file <code>lib/service_client</code>. To experiment with that
67
+ code, run <code>bin/console</code> for an interactive prompt.</p>
68
+
69
+ <h2 id="installation">Installation</h2>
70
+
71
+ <p>Add this line to your application’s Gemfile:</p>
72
+
73
+ <p><code>ruby
74
+ gem 'service_client'
75
+ </code></p>
76
+
77
+ <p>And then execute:</p>
78
+
79
+ <p><code>bash
80
+ bundle install
81
+ </code></p>
82
+
83
+ <p>Or install it yourself as:</p>
84
+
85
+ <p><code>bash
86
+ gem install service_client
87
+ </code></p>
88
+
89
+ <h2 id="usage">Usage</h2>
90
+
91
+ <p>Basic usage example:</p>
92
+
93
+ <pre>
94
+ class CustomerClient < ServiceClient::Base
95
+ def find(id)
96
+ response = get(“https://api.com/customers/#id”)
97
+
98
+ response.data
99
+ rescue ServiceClient::Errors::NoDataFoundError => e
100
+ puts e.response.code # 404
101
+ puts e.response.headers
102
+ puts e.response.data
103
+ rescue ServiceClient::Errors::InternalServerError => e
104
+ puts e.response.code # 500
105
+ puts e.response.headers
106
+ puts e.response.data
107
+ # All errors of HTTP status code
108
+ end
109
+
110
+ def all
111
+ get(nil)
112
+ rescue ServiceClient::ParamsRequired => e
113
+ puts e.message
114
+ end
115
+ </pre>
116
+
117
+ <h2 id="methods-of-class">Methods of class</h2>
118
+
119
+ <h1 id="get">GET</h1>
120
+ <code>
121
+ ServiceClient::Base.get(url, headers:)
122
+ </code>
123
+
124
+ <h1 id="post">POST</h1>
125
+ <code>
126
+ ServiceClient::Base.post(url, headers:, body:)
127
+ </code>
128
+
129
+ <h1 id="put">PUT</h1>
130
+ <code>
131
+ ServiceClient::Base.put(url, headers:, body:)
132
+ </code>
133
+
134
+ <h1 id="delete">DELETE</h1>
135
+ <code>
136
+ ServiceClient::Base.delete(url, headers:, body:)
137
+ </code>
138
+
139
+ <h2 id="classes-of-errors">Classes of errors</h2>
140
+
141
+ <pre>
142
+ # 400 – Bad Request
143
+ ServiceClient::Errors::BadRequestError
144
+ # 401 – Unauthorized
145
+ ServiceClient::Errors::UnauthorizedError
146
+ # 402 – Payment Required
147
+ ServiceClient::Errors::PaymentRequiredError
148
+ # 403 – Forbidden
149
+ ServiceClient::Errors::ForbiddenError
150
+ # 404 – Not Found
151
+ ServiceClient::Errors::NotFoundError
152
+ # 405 – Method Not Allowed
153
+ ServiceClient::Errors::MethodNotAllowedError
154
+ # 406 – Not Acceptable
155
+ ServiceClient::Errors::NotAcceptableError
156
+ # 407 – Proxy Authentication Required
157
+ ServiceClient::Errors::ProxyAuthenticationRequiredError
158
+ # 408 – Request Timeout
159
+ ServiceClient::Errors::RequestTimeoutError
160
+ # 409 – Conflict
161
+ ServiceClient::Errors::ConflictError
162
+ # 410 – Gone
163
+ ServiceClient::Errors::GoneError
164
+ # 411 – Length Required
165
+ ServiceClient::Errors::LengthRequiredError
166
+ # 412 – Precondition Failed
167
+ ServiceClient::Errors::PreconditionFailedError
168
+ # 413 – Request Entity Too Large
169
+ ServiceClient::Errors::RequestEntityTooLargeError
170
+ # 414 – Request-URI Too Long
171
+ ServiceClient::Errors::RequestURITooLongError
172
+ # 415 – Unsupported Media Type
173
+ ServiceClient::Errors::UnsupportedMediaTypeError
174
+ # 416 – Requested Range Not Satisfiable
175
+ ServiceClient::Errors::RequestedRangeNotSatisfiableError
176
+ # 417 – Expectation Failed
177
+ ServiceClient::Errors::ExpectationFailedError
178
+ # 420 – Enhance Your Calm
179
+ ServiceClient::Errors::EnhanceYourCalmError
180
+ # 422 – Unprocessable Entity
181
+ ServiceClient::Errors::UnprocessableEntityError
182
+ # 423 – Locked
183
+ ServiceClient::Errors::LockedError
184
+ # 424 – Failed Dependency
185
+ ServiceClient::Errors::FailedDependencyError
186
+ # 426 – Upgrade Required
187
+ ServiceClient::Errors::UpgradeRequiredError
188
+ # 428 – Precondition Required
189
+ ServiceClient::Errors::PreconditionRequiredError
190
+ # 429 – Too Many Requests
191
+ ServiceClient::Errors::TooManyRequestsError
192
+ # 431 – Request Header Fields Too Large
193
+ ServiceClient::Errors::RequestHeaderFieldsTooLargeError
194
+ # 444 – No Response
195
+ ServiceClient::Errors::NoResponseError
196
+ # 449 – Retry With
197
+ ServiceClient::Errors::RetryWithError
198
+ # 450 – Bllocked by Windows Parental Controls
199
+ ServiceClient::Errors::BlockedByWindowsParentalControlsError
200
+ # 451 – Unavailable For Legal Reasons
201
+ ServiceClient::Errors::UnavailableForLegalReasonsError
202
+ # 499 – Client Closed Request
203
+ ServiceClient::Errors::ClientClosedRequestError
204
+ # 500 – Internal Server Error
205
+ ServiceClient::Errors::InternalServerError
206
+ # 501 – Not Implemented
207
+ ServiceClient::Errors::NotImplementedError
208
+ # 502 – Bad Gateway
209
+ ServiceClient::Errors::BadGatewayError
210
+ # 503 – Service Unavailable
211
+ ServiceClient::Errors::ServiceUnavailableError
212
+ # 504 – Gateway Timeout
213
+ ServiceClient::Errors::GatewayTimeoutError
214
+ # 505 – HTTP Version Not Supported
215
+ ServiceClient::Errors::HTTPVersionNotSupportedError
216
+ # 506 – Variant Also Negotiates
217
+ ServiceClient::Errors::VariantAlsoNegotiatesError
218
+ # 507 – Insufficient Storage
219
+ ServiceClient::Errors::InsufficientStorageError
220
+ # 508 – Loop Detected
221
+ ServiceClient::Errors::LoopDetectedError
222
+ # 510 – Not Extended
223
+ ServiceClient::Errors::NotExtendedError
224
+ # 511 – Network Authentication Required
225
+ ServiceClient::Errors::NetworkAuthenticationRequiredError
226
+ # 598 – Network Read Timeout Error
227
+ ServiceClient::Errors::NetworkReadTimeoutError
228
+ # 599 – Network Connect Timeout Error
229
+ ServiceClient::Errors::NetworkConnectTimeoutError
230
+ </pre>
231
+
232
+
233
+ <h2 id="development">Development</h2>
234
+
235
+ <p>After checking out the repo, run <code>bin/setup</code> to install dependencies. Then, run
236
+ <code>rake spec</code> to run the tests. You can also run <code>bin/console</code> for an interactive prompt
237
+ that will allow you to experiment.
238
+ </p>
239
+
240
+ <p>To install this gem onto your local machine, run <code>bundle exec rake install</code>. To release a new
241
+ version, update the version number in <code>version.rb</code>, and then run
242
+ <code>bundle exec rake release</code>, which will create a git tag for the version, push git commits and tags,
243
+ and push the <code>.gem</code> file to <a href="https://rubygems.org">rubygems.org</a>.
244
+ </p>
245
+
246
+ <h2 id="contributing">Contributing</h2>
247
+
248
+ <p>Bug reports and pull requests are welcome on GitHub at https://github.com/nemuba/service_client.</p>
249
+
250
+ <h2 id="license">License</h2>
251
+
252
+ <p>The gem is available as open source under the terms of the <a href="https://opensource.org/licenses/MIT">MIT
253
+ License</a>.</p>
254
+ </div>
255
+ </div>
256
+
257
+ <div id="footer">
258
+ Generated on Wed Feb 22 21:05:55 2023 by
259
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
260
+ 0.9.28 (ruby-2.7.1).
261
+ </div>
262
+
263
+ </div>
264
+ </body>
265
+
266
+ </html>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ServiceClient
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alef Ojeda de Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-22 00:00:00.000000000 Z
11
+ date: 2023-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -43,7 +43,8 @@ email:
43
43
  - alef.oliveira@dimensa.com.br
44
44
  executables: []
45
45
  extensions: []
46
- extra_rdoc_files: []
46
+ extra_rdoc_files:
47
+ - doc/index.html
47
48
  files:
48
49
  - Gemfile
49
50
  - Gemfile.lock
@@ -53,6 +54,7 @@ files:
53
54
  - Rakefile
54
55
  - bin/console
55
56
  - bin/setup
57
+ - doc/index.html
56
58
  - lib/service_client.rb
57
59
  - lib/service_client/base.rb
58
60
  - lib/service_client/errors.rb
@@ -73,14 +75,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
75
  requirements:
74
76
  - - ">="
75
77
  - !ruby/object:Gem::Version
76
- version: 2.3.0
78
+ version: 2.7.1
77
79
  required_rubygems_version: !ruby/object:Gem::Requirement
78
80
  requirements:
79
81
  - - ">="
80
82
  - !ruby/object:Gem::Version
81
83
  version: '0'
82
84
  requirements: []
83
- rubygems_version: 3.1.2
85
+ rubygems_version: 3.4.7
84
86
  signing_key:
85
87
  specification_version: 4
86
88
  summary: Service client