tinder-ruby 0.1.0 → 0.1.1

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: da1807f4635a77c3c940fe7ef9f16e1d00e74254
4
- data.tar.gz: bf05b73c63d775980cd1da78db69fef1461ae54f
3
+ metadata.gz: 87f72f03aabee545039a73733073b4b1018a4c46
4
+ data.tar.gz: b4c7a614a9ccf3e2037c24ee19566711b336fb0a
5
5
  SHA512:
6
- metadata.gz: 193d5617adec79ac83b9d129e7c0cf74bb89af593508d5de6d7f4042304af0c741e926182bb0c1e4ea07093784f00324027a5f238e0674eec7cc0863d7fbc867
7
- data.tar.gz: 24aae541159580191ce7e7fd906387bbe881e8562a6a133eff76fbbb279dbe391059c517f5096823c77fedd5a429d06005576be7448a6edd40c0dd93dc9950da
6
+ metadata.gz: a319cec4afd224fa30efc8d3ba46189405d52008dc12dacd1298ba6e1d17cb4977474ac4384e95817bd13e1e7dfd7b8e70b076457a3c4ea58ce270b6508341cb
7
+ data.tar.gz: b76ba2e50525f9562be1e27a1871adf63c6938d635eded4d27b0dee74f4ee70955112a76907bb0c136b55b59957b2701ee4675a009320880e61b0ee422f3a865
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tinder-ruby (0.1.0)
4
+ tinder-ruby (0.1.1)
5
5
  dotenv (~> 2.2.1)
6
6
 
7
7
  GEM
@@ -11,8 +11,39 @@ module Tinder
11
11
  JSON.parse(res.body)
12
12
  end
13
13
 
14
+ def recs
15
+ res = Util.get('/user/recs', {}, {'X-Auth-Token': token})
16
+ JSON.parse(res.body)['results']
17
+ end
18
+
19
+ def user(id)
20
+ res = Util.get('/user/' + id, {}, {'X-Auth-Token': token})
21
+ JSON.parse(res.body)['results']
22
+ end
23
+
14
24
  def profile
15
- res = Util.post('/profile', {}, {'X-Auth-Token': token})
25
+ res = Util.get('/profile', {}, {'X-Auth-Token': token})
26
+ JSON.parse(res.body)
27
+ end
28
+
29
+ def change_filter(age_filter_min: 18, age_filter_max: 30, gender: 0, gender_filter: 1, distance_filter: 50)
30
+ if gender.is_a?(String)
31
+ gender = gender == 'man' ? 0 : 1
32
+ end
33
+
34
+ if gender_filter.is_a?(String)
35
+ gender_filter = gender_filter == 'man' ? 0 : 1
36
+ end
37
+
38
+ payload = {
39
+ age_filter_min: age_filter_min,
40
+ age_filter_max: age_filter_max,
41
+ gender: gender,
42
+ gender_filter: gender_filter,
43
+ distance_filter: distance_filter
44
+ }
45
+
46
+ res = Util.post('/profile', payload, {'X-Auth-Token': token})
16
47
  JSON.parse(res.body)
17
48
  end
18
49
 
@@ -25,6 +25,10 @@ module Tinder
25
25
  https.request(req)
26
26
  end
27
27
 
28
+ def get(endpoint, payload, headers = {})
29
+ request(:get, endpoint, payload, headers)
30
+ end
31
+
28
32
  def post(endpoint, payload, headers = {})
29
33
  request(:post, endpoint, payload, headers)
30
34
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "tinder-ruby"
7
- spec.version = "0.1.0"
7
+ spec.version = "0.1.1"
8
8
  spec.authors = ["ts-3156"]
9
9
  spec.email = ["ts_3156@yahoo.co.jp"]
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinder-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ts-3156