apicasso_brush 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apicasso/brush.rb +4 -4
- data/lib/apicasso_brush/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a738a104da128abfd332a26badbf2778fb687bbcfbd2e08418bb21757de14cb
|
4
|
+
data.tar.gz: 3a6a86da89689ab48a1cec3630c8740a7e4db7682617aed4cf78fa6c997fa9e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37d1ab34aaaedf081875b8187dedd974abae46079721a00b6293e1b7da715da806452ca184eebf326e8c92a094987b6af1b57e4bbca78172b4320cd054424c12
|
7
|
+
data.tar.gz: 2f1cb984a94b7fdaadfd779b06ee2eb29e931260fd5e9a4f1a843208e4a7efd1fae223f720b3008d3407481a9a85286a332258d287af51c2e81cd9067f9d4772
|
data/lib/apicasso/brush.rb
CHANGED
@@ -113,8 +113,8 @@ module Apicasso
|
|
113
113
|
|
114
114
|
brush_collection(JSON.parse(retrieve(http, post_request(url, opts)).read_body))
|
115
115
|
else
|
116
|
-
http = Net::HTTP.new(url.host, url.port)
|
117
116
|
url = URI.parse(resource_url.to_s)
|
117
|
+
http = Net::HTTP.new(url.host, url.port)
|
118
118
|
|
119
119
|
new(nil, JSON.parse(retrieve(http, post_request(url, opts)).read_body))
|
120
120
|
end
|
@@ -134,7 +134,7 @@ module Apicasso
|
|
134
134
|
|
135
135
|
# Finds a object based on attributes conditions
|
136
136
|
def self.find_by(opts = {})
|
137
|
-
where(opts)[:entries][0
|
137
|
+
where(opts).to_h[:entries].try(:[], 0)
|
138
138
|
end
|
139
139
|
|
140
140
|
# Finds a object based on attributes conditions,
|
@@ -240,7 +240,7 @@ module Apicasso
|
|
240
240
|
request = Net::HTTP::Patch.new(url)
|
241
241
|
request['Authorization'] = "Token token=#{apicasso_token}"
|
242
242
|
request['Content-Type'] = 'application/json'
|
243
|
-
request.body = {
|
243
|
+
request.body = { resource_url.split('/').last.singularize => body }.to_json
|
244
244
|
request
|
245
245
|
end
|
246
246
|
|
@@ -248,7 +248,7 @@ module Apicasso
|
|
248
248
|
request = Net::HTTP::Post.new(url)
|
249
249
|
request['Authorization'] = "Token token=#{apicasso_token}"
|
250
250
|
request['Content-Type'] = 'application/json'
|
251
|
-
request.body = {
|
251
|
+
request.body = { resource_url.split('/').last.singularize => body }.to_json
|
252
252
|
request
|
253
253
|
end
|
254
254
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apicasso_brush
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernando Bellincanta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|