alloy-api 0.0.2 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/alloy-api.rb +20 -4
- 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: 5a08b628f971e1a9f8f86238fc13f71c88bf592e402bdafa7b5044fef8c822bf
|
4
|
+
data.tar.gz: 0ace081b0bec3227c5dc3f925f126eee963fbdd0a15c4e7ee966559aeeb9b206
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fecd7e60e97d858b2bcceee8afe3203d397fd55e58e6daeee2913b2f84e081605632a713311b33ef6e6ea9a311326527de9d563c36fbc2c949ea1f10cc0c5979
|
7
|
+
data.tar.gz: 5d569b724c31aeeb7868868613ab3b7854176ba0d814085d3cf3b105112882533de95e52bad98a95c993b1481485430a0a60040f88e83ff36d255bf7483a6981
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## 0.0.5 / 2020-06-11
|
2
|
+
|
3
|
+
* Method corrections
|
4
|
+
* Add entity_details
|
5
|
+
|
6
|
+
## 0.0.4 / 2020-06-11
|
7
|
+
|
8
|
+
* Allow raw output
|
9
|
+
|
10
|
+
## 0.0.3 / 2020-06-11
|
11
|
+
|
12
|
+
* Allow calling the API by path
|
13
|
+
|
1
14
|
## 0.0.2 / 2020-06-10
|
2
15
|
|
3
16
|
* Change gem homepage/repo page
|
data/lib/alloy-api.rb
CHANGED
@@ -20,16 +20,32 @@ module Alloy
|
|
20
20
|
@@api_secret = value
|
21
21
|
end
|
22
22
|
|
23
|
+
def self.parameters(options={})
|
24
|
+
perform "parameters", options.merge(method: :get)
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.entity_details(entity_id, options = {})
|
28
|
+
perform "entities/#{entity_id}", options.merge(method: :get)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.evaluation_details(entity_id, evaluation_id, options = {})
|
32
|
+
perform "entities/#{entity_id}/evaluations/#{evaluation_id}", options.merge(method: :get)
|
33
|
+
end
|
34
|
+
|
23
35
|
def self.method_missing(m, *args, &block)
|
24
|
-
|
36
|
+
perform(m, args[0] || {})
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.perform(path, options={})
|
25
40
|
method = options[:method] || "post"
|
26
|
-
uri = "#{@@api_uri}#{
|
41
|
+
uri = "#{@@api_uri}#{path}"
|
27
42
|
headers = {
|
28
43
|
"Content-Type" => "application/json",
|
29
44
|
"Authorization" => auth_param
|
30
45
|
}.merge(options[:headers].to_h)
|
31
|
-
|
32
|
-
|
46
|
+
response = HTTParty.send(method, uri, {headers: headers, body: (options[:body] || {}).to_json})
|
47
|
+
return response if options[:raw]
|
48
|
+
JSON.parse(response.body)
|
33
49
|
# TODO: Error handling
|
34
50
|
end
|
35
51
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alloy-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Schultz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|