zoid 0.1.3 → 0.1.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: 9a63e1d2b203aebccc51708817528c0f332f88e8
4
- data.tar.gz: bc57753b13514dd77383783a84a36e82ee5f54cb
3
+ metadata.gz: 0e44e7b2b56a5c41d92a61b29b9ee083c9e36020
4
+ data.tar.gz: f287168ddde47cf69186f6440649682e84340f2c
5
5
  SHA512:
6
- metadata.gz: 32ba5dc4e79e1fbc9475cdeb5b1631547a44887576a2f497a6faa36e75d97027f2ca0d9ca5d384159a4f49077ef6e8b8510145632da3fbc5b7740513c157dba3
7
- data.tar.gz: f22aaad282448e01dc3118c3773782921f2898aa314630880ba472bcd3ab5a4bdc029b3c13e7c6fbdf93d3a02e632db25187b3281d0b49672a4b7bd8ee94fbd9
6
+ metadata.gz: b53fd021ba3805874bdf92ced9fc1bb682d6f3f762f68f1cd563ed2d4f9fa70155d79c37ad28307e2b3c3a3005d1cdc5bfe483eb90f58ad3cdafad7c48ca285d
7
+ data.tar.gz: 0cad0782569956d1d8c89ac004b46e9ba2d50ab2c24d9f7eed599738137c30c9ed888d741ece06b5cce4b393328a8a53075984bb5fc783e2c468844c71f1d578
@@ -23,10 +23,23 @@ module Zoid
23
23
  Zoid::Response.new(response.status, response.body)
24
24
  end
25
25
 
26
+ def post(path, params = {})
27
+ response = connection.post do |request|
28
+ request.path = path
29
+ request.headers['Content-Type'] = "application/json"
30
+ request.params = params
31
+
32
+ yield if block_given?
33
+ end
34
+
35
+ Zoid::Response.new(response.status, response.body)
36
+ end
37
+
26
38
  private
27
39
 
28
40
  def connection(&block)
29
41
  @connection ||= Faraday.new(connection_options) do |builder|
42
+ builder.request :json
30
43
  builder.response :json
31
44
 
32
45
  @builder.call(builder) if @builder
@@ -1,3 +1,3 @@
1
1
  module Zoid
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Sarcevic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday