reddit-base 0.6.1 → 0.6.2

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: 6b9514d61736cbfc576154ec7f0904ba8a4ab571
4
- data.tar.gz: 650bd07115d39f848adcc7647fbda68250b99b6d
3
+ metadata.gz: cc0d8fdb18c413fa9cfee4924efa8963844af5d9
4
+ data.tar.gz: ead59a31ec2651cb05b89ead52b6bcacfa7e2b30
5
5
  SHA512:
6
- metadata.gz: f4d9838575ebd613b6167b7f0bfb98f664b5a016c0ad98440c78466108572b76bfb653e9ec6f0f6bb24574869e602aec72f9822e4168dcec220666852c436b19
7
- data.tar.gz: 2c7205e185631f4f49e5c99f59f1c71e00fa80a2a0e4b47b4097b2b1e4208da0ca9cbe719958667cbaedeb94ed0d92c2a5274f00eb0ec2d2f16b41c83ba461a3
6
+ metadata.gz: 54c36fae52dac4d3908c5b2c041adbddf7d0d1da6c736b7c6edcee1a9006413c67f8d628ac16792f2870b780b4cade58e5723989bdc7d4c304c1fee04fe0d7d1
7
+ data.tar.gz: 3de1b1da1f32dee06612317964c6ed6ac6bb9e66bbff50b2dd4e1fec926acf890809b440de1b40e4efea674ae026b1cc6d77d1fef7efd840197500b8d6467ff7
@@ -17,7 +17,7 @@ module Reddit
17
17
  nocache = options.delete(:nocache)
18
18
 
19
19
  response = connection.delete(url, **options)
20
- Mash.new response.body
20
+ mash response
21
21
  end
22
22
 
23
23
  def get(url, **options)
@@ -29,21 +29,29 @@ module Reddit
29
29
  req.params = options
30
30
  end
31
31
 
32
- Mash.new response.body
32
+ mash response
33
33
  end
34
34
 
35
35
  def post(url, **options)
36
36
  nocache = options.delete(:nocache)
37
37
 
38
38
  response = connection.post(url, **options)
39
- Mash.new response.body
39
+ mash response
40
40
  end
41
41
 
42
42
  def put(url, **options)
43
43
  nocache = options.delete(:nocache)
44
44
 
45
45
  response = connection.put(url, **options)
46
- Mash.new response.body
46
+ mash response
47
+ end
48
+
49
+ def mash(response)
50
+ if response.body.is_a? Array
51
+ response.body.map { |x| Mash.new x }
52
+ else
53
+ Mash.new response.body
54
+ end
47
55
  end
48
56
  end
49
57
  end
@@ -1,5 +1,5 @@
1
1
  module Reddit
2
2
  module Base
3
- VERSION = '0.6.1'
3
+ VERSION = '0.6.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reddit-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel O'Brien