firstjob_api 1.0.6 → 1.0.7

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: 285e8de5548820e36fb1089d035f92f8e5024564
4
- data.tar.gz: 601df2c3c62e21dc9dec5a6ce56f08b205296fa5
3
+ metadata.gz: 854f739a684309d4ed7bd018e454d9d65c8c8639
4
+ data.tar.gz: ac0971ed53545001e73983f0b7287c05ee1a13dc
5
5
  SHA512:
6
- metadata.gz: 51052a8a71aa8aca16df17b3e261121f1fc613716b9ab6748cff2b1f02eb31468cc551d1a8e69a3852005722b1280687f3c1e661e6f7754274ea47d7d0a718b7
7
- data.tar.gz: 172c7bf68bc84f40e57d54b7589fdcb469dbc83cd80ad6e2aa1f9de72e56e1063efbde0612dfd0a803d7aabaeda7554ccf9504a7b433d70e7df0ebc3cb18eae0
6
+ metadata.gz: b3bf1a2b056e3d503a857fcfe667b581a55dde67d196b660cdc4f131729705908fdbb00e4546914f5a928a2a3280a25927a62de138abbac4492fb477546acb5e
7
+ data.tar.gz: 4a9ebfdcf46fe5bad57960bb045d7257d6b5a23d433796d52b0d1ce6295b0c6b047d41c9da0f14cc5985e784a58ef36e53a162d0c527d1c388914921e648f644
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- firstjob_api (1.0.6)
4
+ firstjob_api (1.0.7)
5
5
  httparty (>= 0.13.3)
6
6
  rails (>= 3.2)
7
7
 
@@ -51,7 +51,7 @@ module FirstjobApi
51
51
  "#{FirstjobApi.base_uri}/jobs/#{slug}"
52
52
  end
53
53
 
54
- def postulants
54
+ def get_postulants
55
55
  # Get postulants
56
56
  response = FirstjobApi.post("/api/get_applicants_job",
57
57
  FirstjobApi.options.merge(
@@ -61,8 +61,17 @@ module FirstjobApi
61
61
  response_body = HttpParser.parse_json_response(response)
62
62
 
63
63
  # load results
64
- @postulantes = response_body["postulantes"]
65
- return @postulantes
64
+ if response_body && response_body["postulaciones"]
65
+ @postulantes = response_body["postulaciones"]["postulantes"]
66
+ else
67
+ # In case the API changes... fallback to response body
68
+ @postulantes = response_body
69
+ end
70
+ return response
71
+ end
72
+
73
+ def postulants
74
+ @postulantes || get_postulants && @postulantes
66
75
  end
67
76
 
68
77
  def destroy
@@ -1,3 +1,3 @@
1
1
  module FirstjobApi
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firstjob_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Fernandez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-24 00:00:00.000000000 Z
11
+ date: 2017-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails