zoid 0.2.0 → 0.3.0

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: 038b01afb87303eb4d5f931f810d836dfb6fc175
4
- data.tar.gz: 363a967bb84703b6770362c06389a6087314f11d
3
+ metadata.gz: 0682a01a12a7c9dca0a8f8c28eb6f5139e72da3c
4
+ data.tar.gz: 48046edb6e2a79acb8830b20c643295a8bffbd81
5
5
  SHA512:
6
- metadata.gz: b4a538dbfdf90e86c0ce232c6dfff0ed428e802f17bab1c5d5b09fab45914b29306cb940d562749aeb8373506ef80909bf1968610c1f87994ee006cf942cf738
7
- data.tar.gz: b97a631bc9e4ac381eec3682a8a54b665fef5070b964e5edbbbfba5e1923247434f049b2a99dd742ec3cbae4db9837e5f8f17c702a6b5a74abb886ef2906ed67
6
+ metadata.gz: d038eb2d844e8cac63c14b7a5af0732f786dba59da4b8290edceeb8c41a466dc01c39d8d421fb59c69014377d1a66ecda84b86e1a291d7afce34018b00194ad5
7
+ data.tar.gz: a37e0774394b1f3d55d1b16e3d8ef90eede70a368ed1b51584551b229b9c91bfaf77cff9bf271e7726266d321d5c38f618d55e1a20c6d4cb9706df14122a06ea
data/README.md CHANGED
@@ -23,9 +23,7 @@ The body is already parsed, and ready for consumation
23
23
  ``` rb
24
24
  closed_issues = response.body
25
25
 
26
- titles = closed_issues.map { |issue| issue.title }
27
-
28
- puts titles
26
+ closed_issues.pluck(&:title)
29
27
  ```
30
28
 
31
29
  ### Configuring the connection
@@ -35,6 +35,42 @@ module Zoid
35
35
  Zoid::Response.new(response.status, response.body)
36
36
  end
37
37
 
38
+ def put(path, params = {})
39
+ response = connection.put do |request|
40
+ request.path = path
41
+ request.headers['Content-Type'] = "application/json"
42
+ request.body = params
43
+
44
+ yield if block_given?
45
+ end
46
+
47
+ Zoid::Response.new(response.status, response.body)
48
+ end
49
+
50
+ def patch(path, params = {})
51
+ response = connection.patch do |request|
52
+ request.path = path
53
+ request.headers['Content-Type'] = "application/json"
54
+ request.body = params
55
+
56
+ yield if block_given?
57
+ end
58
+
59
+ Zoid::Response.new(response.status, response.body)
60
+ end
61
+
62
+ def delete(path, params = {})
63
+ response = connection.delete do |request|
64
+ request.path = path
65
+ request.headers['Content-Type'] = "application/json"
66
+ request.body = params
67
+
68
+ yield if block_given?
69
+ end
70
+
71
+ Zoid::Response.new(response.status, response.body)
72
+ end
73
+
38
74
  private
39
75
 
40
76
  def connection(&block)
@@ -1,3 +1,3 @@
1
1
  module Zoid
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Sarcevic