lucid_http 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lucid_http/version.rb +1 -1
- data/lib/lucid_http.rb +23 -21
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d50a39cf7a043cecb6161f1bbedf343697cf31b5
|
4
|
+
data.tar.gz: 6bc3521ad69b60348601a85622b5c6b8b3e14825
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17723a2514b88919984296e86bce7c7040f014a4c05dbc95352e49c09c67d3c79065991f80d6f2435e244e19f942689616af5aa85e7fba2b338f990a1abe1466
|
7
|
+
data.tar.gz: 367e0238a8b8da4a419874ff1ee6b78bd1776cff8fcc1ce77337bb89435a22ade517d2ce3578a5203a61959152d1089ac9d6db40114709e35fbe461e9655537a
|
data/lib/lucid_http/version.rb
CHANGED
data/lib/lucid_http.rb
CHANGED
@@ -73,26 +73,28 @@ def error
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
76
|
+
%i[get post put patch delete].each do |verb|
|
77
|
+
define_method(verb.upcase) do |url, **opts|
|
78
|
+
__lucid_http__setup(url, action: verb, **opts)
|
79
|
+
new_body = case status.to_i
|
80
|
+
when 200
|
81
|
+
body
|
82
|
+
else
|
83
|
+
"STATUS: #{status}"
|
84
|
+
end
|
85
|
+
|
86
|
+
new_body
|
87
|
+
end
|
86
88
|
end
|
87
89
|
|
88
|
-
def POST(url, **opts)
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
end
|
90
|
+
# def POST(url, **opts)
|
91
|
+
# __lucid_http__setup(url, action: :post, **opts)
|
92
|
+
# new_body = case status.to_i
|
93
|
+
# when 200
|
94
|
+
# body
|
95
|
+
# else
|
96
|
+
# "STATUS: #{status}"
|
97
|
+
# end
|
98
|
+
|
99
|
+
# new_body
|
100
|
+
# end
|