putson 0.1.0 → 0.2.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: 414aae2f94f8f3de1f5c6900c7ea9ba4dcaae32f
4
- data.tar.gz: 9c19359915beccc0eccbce1a338110ed9b1f27ba
3
+ metadata.gz: 797fec819e3d1d42e91130dcfbbdebdab1d83ca8
4
+ data.tar.gz: 33cc61a5ac947e2d3e7901fd60b356817a3e10dd
5
5
  SHA512:
6
- metadata.gz: b278c40c4c0b21d768e6f63730d7f8043350007ce5da783dbc657e6f4a4557c8ef5fa5ac4bac739c49c8c2c956d8b573fa19705d0b7f3a30b7af85360671653d
7
- data.tar.gz: 954abade3c53c383a99b5df2a61367a7d2b0e1cbc19ea5220620dca98a9a0a52cdf6aac1e89bcc273bf4728c4a2099ebe8e34106e4ce83aedaf44be5b98546a2
6
+ metadata.gz: b5f7e1d4922f67f439cb3c8ad940705e70ce97890bb09bdb60d639cfbce84e4d44bb4a015aa124dee2d1e18c58fa7e45b0fe8c5a7e587ca39ae5c8dc161b2817
7
+ data.tar.gz: b0097dc0f32b04c9fe4a5074d720afcbf21c79a4d6b9c5da6d7e7ab62c29eddd1c6e0b77699eafe2b568a3a9a07cffbbcc996427079dae8f30d59a3b3aa91468
data/README.md CHANGED
@@ -30,7 +30,7 @@ Post some data
30
30
  ```ruby
31
31
  # Data can be JSON (as a string). Or another object that responds to `to_json`.
32
32
  > putson.post({yo: 'lo'})
33
- => "lwdaz"
33
+ => "https://api.myjson.com/bins/lwdaz"
34
34
  ```
35
35
 
36
36
  Get some data
@@ -45,7 +45,7 @@ Get some data
45
45
  Update some data
46
46
  ```ruby
47
47
  > putson.put({yo: 'no'})
48
- => "lwdaz"
48
+ => "https://api.myjson.com/bins/lwdaz"
49
49
  > putson.get
50
50
  => "{\"yo\":\"no\"}"
51
51
  ```
@@ -36,11 +36,17 @@ module Putson
36
36
  response.body
37
37
  end
38
38
 
39
+ def url
40
+ return if id.nil?
41
+ "#{URL}bins/#{id}"
42
+ end
43
+
39
44
  private
40
45
 
41
46
  def parse_post_response(response)
42
47
  body = JSON.parse(response.body)
43
48
  @id ||= body.fetch('uri', nil).gsub("#{URL}bins/", '')
49
+ url
44
50
  end
45
51
 
46
52
  def client
@@ -1,3 +1,3 @@
1
1
  module Putson
2
- VERSION = "0.1.0"
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: putson
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Reed