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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56d376bdcb3b963ff85f5b8120a92b18444263fa
4
- data.tar.gz: 84a70ced5519fd281c4f347d0f3ffbe86580e815
3
+ metadata.gz: 6abe80347954b35ae9b1b7420f0ad9a62abcc622
4
+ data.tar.gz: 86d02e12a4a28731682f98416f04c6a8d159414b
5
5
  SHA512:
6
- metadata.gz: 4b96311361b9a8de98e116ffc23308701ca49b8ec3e8f3ffd730df8434e53982a1315f0bf94e4c69b4c4e18b9f7f06c9f5251f650a5e53b62bb39bf4c6926fd9
7
- data.tar.gz: f18a61f9f99903cc54d1981d40e70716170b3775e187d0091af943c2ed45fb3d5c03d1f1aeb0580a02833d9a5cc88e0daa86b17e907f8203ac71d0f05528a89e
6
+ metadata.gz: 5eea7efc4c620f4a2e5bf232069f4176ff1674fb03e9286cdd673f15137bc159d9839e2cc9c9a777781c20ec997186c6fb214c67d26c5dfb5aadd9210b3647db
7
+ data.tar.gz: aa86eaf8a332d2e4ec63cd2d9836870888c8102a01af94fc9ff8a8d25e4a5127be3e7984e4118239431446ee3da7ede289e880042501c3c3cd6e37f62bbb5d05
@@ -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
- self.class.delete(path, query: @default_query, headers: @headers)
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
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module ThisData
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
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.3
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-06-28 00:00:00.000000000 Z
12
+ date: 2017-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty