miracle_grow 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58c24968c2b9282407f819e219a78cd2afe4af3d
4
- data.tar.gz: af0c11ec1f793ab87affcc664bf74698b45bc53c
3
+ metadata.gz: 17ca36ea4fc55033e81eadbfead0e573fcafbe91
4
+ data.tar.gz: c4384f1393e325dc2f5b7c0daf9474beb14af064
5
5
  SHA512:
6
- metadata.gz: 517980c85571326da36bf50d4fa25915de0a8933550bedc3c499b9ed936f2c044bcf45fcf122959ee5eb75857e0dbd2435b88acf1bd90aef0ac30021e260cc59
7
- data.tar.gz: 11d1d1125a702bf600b794ae49089205bdce98a724e2d208a6070fc27e986715852fb68e9c97df3090463d9ba46036e1e885ed5f97ec91874cc3420a57746f2d
6
+ metadata.gz: 39140905ab89582ca44daea2bf2b79dde85ba8761c3727932e3604c8d7d73b728f46e2def1a8deea4d64d9f21451feec53878a011ded11bb085818e66daa6d3e
7
+ data.tar.gz: 05b86776c4fe90a891f58acee6139149f2b349204038f5769d89400d541215d4299e4a8d9e9ba2b712a99f3990d6f7c271d8b76a374739c2a69242d0016463ed
@@ -3,6 +3,18 @@ module MiracleGrow
3
3
  class Bed
4
4
  class << self
5
5
 
6
+ def find_bed(id)
7
+ response = Faraday.get("http://localhost:8080/api/v1/beds/#{id}")
8
+ JSON.parse(response.body)
9
+ end
10
+
11
+ def create_bed(params)
12
+ Faraday.post('http://localhost:8080/api/v1/beds') do |req|
13
+ request = params
14
+ req.body = params
15
+ end
16
+ end
17
+
6
18
  def patch_bed(params)
7
19
  Faraday.put("http://localhost:8080/api/v1/beds/#{(params[:id])}") do |req|
8
20
  request = params
@@ -29,18 +41,18 @@ module MiracleGrow
29
41
  if current_users_beds.length > 0
30
42
  i = current_users_beds.index(bed)
31
43
  if current_users_beds[i + 1]
32
- @next = current_users_beds[i + 1]
44
+ next = current_users_beds[i + 1]
33
45
  else
34
- @next = current_users_beds[0]
46
+ next = current_users_beds[0]
35
47
  end
36
48
 
37
49
  if current_users_beds[i-1]
38
- @prev = current_users_beds[i - 1]
50
+ prev = current_users_beds[i - 1]
39
51
  else
40
- @prev = current_users_beds[-1]
52
+ prev = current_users_beds[-1]
41
53
  end
42
54
  end
43
- [@next, @prev]
55
+ [next, prev]
44
56
  end
45
57
 
46
58
  end
@@ -1,3 +1,3 @@
1
1
  module MiracleGrow
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: miracle_grow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Lewinsky