thisdata 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/this_data/client.rb +3 -2
- data/lib/this_data/rule.rb +10 -10
- data/lib/this_data/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6abe80347954b35ae9b1b7420f0ad9a62abcc622
|
4
|
+
data.tar.gz: 86d02e12a4a28731682f98416f04c6a8d159414b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eea7efc4c620f4a2e5bf232069f4176ff1674fb03e9286cdd673f15137bc159d9839e2cc9c9a777781c20ec997186c6fb214c67d26c5dfb5aadd9210b3647db
|
7
|
+
data.tar.gz: aa86eaf8a332d2e4ec63cd2d9836870888c8102a01af94fc9ff8a8d25e4a5127be3e7984e4118239431446ee3da7ede289e880042501c3c3cd6e37f62bbb5d05
|
data/lib/this_data/client.rb
CHANGED
@@ -50,8 +50,9 @@ module ThisData
|
|
50
50
|
|
51
51
|
# Perform a DELETE request against the ThisData API, with the API key
|
52
52
|
# prepopulated
|
53
|
-
def delete(path)
|
54
|
-
|
53
|
+
def delete(path, query: {})
|
54
|
+
query = @default_query.merge(query)
|
55
|
+
self.class.delete(path, query: query, headers: @headers)
|
55
56
|
end
|
56
57
|
|
57
58
|
private
|
data/lib/this_data/rule.rb
CHANGED
@@ -10,8 +10,8 @@ module ThisData
|
|
10
10
|
# http://help.thisdata.com/docs/v1rules
|
11
11
|
#
|
12
12
|
# Returns: Array of OpenStruct Rule objects
|
13
|
-
def self.find(id)
|
14
|
-
response = ThisData::Client.new.get("#{ThisData::RULES_ENDPOINT}/#{id}")
|
13
|
+
def self.find(id, options={})
|
14
|
+
response = ThisData::Client.new.get("#{ThisData::RULES_ENDPOINT}/#{id}", query: options)
|
15
15
|
OpenStruct.new( response.parsed_response)
|
16
16
|
end
|
17
17
|
|
@@ -20,8 +20,8 @@ module ThisData
|
|
20
20
|
# http://help.thisdata.com/docs/v1rules
|
21
21
|
#
|
22
22
|
# Returns: Array of OpenStruct Rule objects
|
23
|
-
def self.all
|
24
|
-
response = ThisData::Client.new.get(ThisData::RULES_ENDPOINT)
|
23
|
+
def self.all(options={})
|
24
|
+
response = ThisData::Client.new.get(ThisData::RULES_ENDPOINT, query: options)
|
25
25
|
response.parsed_response.collect do |rule_hash|
|
26
26
|
OpenStruct.new(rule_hash)
|
27
27
|
end
|
@@ -32,8 +32,8 @@ module ThisData
|
|
32
32
|
# http://help.thisdata.com/docs/v1rules-1
|
33
33
|
#
|
34
34
|
# Returns: OpenStruct Rule object
|
35
|
-
def self.create(rule)
|
36
|
-
response = ThisData::Client.new.post(ThisData::RULES_ENDPOINT, body: JSON.generate(rule))
|
35
|
+
def self.create(rule, options={})
|
36
|
+
response = ThisData::Client.new.post(ThisData::RULES_ENDPOINT, body: JSON.generate(rule), query: options)
|
37
37
|
OpenStruct.new(response.parsed_response)
|
38
38
|
end
|
39
39
|
|
@@ -42,9 +42,9 @@ module ThisData
|
|
42
42
|
# http://help.thisdata.com/docs/v1rulesid-1
|
43
43
|
#
|
44
44
|
# Returns: OpenStruct Rule object
|
45
|
-
def self.update(rule)
|
45
|
+
def self.update(rule, options={})
|
46
46
|
rule_id = OpenStruct.new(rule).id
|
47
|
-
response = ThisData::Client.new.post("#{ThisData::RULES_ENDPOINT}/#{rule_id}", body: JSON.generate(rule))
|
47
|
+
response = ThisData::Client.new.post("#{ThisData::RULES_ENDPOINT}/#{rule_id}", body: JSON.generate(rule), query: options)
|
48
48
|
OpenStruct.new(response.parsed_response)
|
49
49
|
end
|
50
50
|
|
@@ -53,8 +53,8 @@ module ThisData
|
|
53
53
|
# http://help.thisdata.com/docs/v1rulesid-2
|
54
54
|
#
|
55
55
|
# Returns: OpenStruct Rule object
|
56
|
-
def self.destroy(id)
|
57
|
-
response = ThisData::Client.new.delete("#{ThisData::RULES_ENDPOINT}/#{id}")
|
56
|
+
def self.destroy(id, options={})
|
57
|
+
response = ThisData::Client.new.delete("#{ThisData::RULES_ENDPOINT}/#{id}", query: options)
|
58
58
|
response.code.eql?(204)
|
59
59
|
end
|
60
60
|
|
data/lib/this_data/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thisdata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ThisData Ltd
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-07-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|