fountain 0.0.2 → 0.0.3

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: b38b462449586bea1c3a1ce67e116b9c439c8e52
4
- data.tar.gz: c83cd25cf68b8099f8ec7b11cb0b2eed89f0f326
3
+ metadata.gz: e7c178b17cde03114db2e4178269ab70cecde4f4
4
+ data.tar.gz: d95e9956f12dac35dbebbb08312210bc251a171b
5
5
  SHA512:
6
- metadata.gz: 55ff9dfeabf1fab057d055b2ae17d6cb5040d6f1a36f4827436d8d108b26996366e58117a5e834b36c2fc7e32d8547fb6abd5c37475c240658648d301e9ebb3e
7
- data.tar.gz: 8bacdea06f7863d57114c3281133ca991a4a5e3cf26172813a137318406f8d337ba053e7bed54df8c492c6d208fedb72ae0abb6480e979335d4c2f35b6e9e33f
6
+ metadata.gz: ccd918c0536dba8522e8cea212bc534ad4889bd10aac9aae23526996beb7837b2c9ee1c7116bbc55dfbbbdbc6e520c9df9ab935fb829ecc49d64b665ecd11800
7
+ data.tar.gz: 118bf9d93d02d66df17f46f60f5bd34fcd20a264722bf8d4e98f268f9f7f72e1c68306489eb4bf56656cb02637c4507a5c54de823ca8e6c373ae9820c0cb8183
@@ -17,6 +17,7 @@ module Fountain
17
17
  end
18
18
 
19
19
  require 'fountain/applicant'
20
+ require 'fountain/applicants'
20
21
  require 'fountain/background_check'
21
22
  require 'fountain/document_signature'
22
23
  require 'fountain/funnel'
@@ -23,7 +23,7 @@ module Fountain
23
23
  :funnel_id, :stage_id, :stage, :labels, :cursor
24
24
  )
25
25
  )
26
- response['applicants'].map { |hash| Fountain::Applicant.new hash }
26
+ Fountain::Applicants.new response
27
27
  end
28
28
 
29
29
  #
@@ -0,0 +1,32 @@
1
+ module Fountain
2
+ #
3
+ # Fountain Applicant collection
4
+ #
5
+ class Applicants
6
+ extend Forwardable
7
+
8
+ # Collection current cursor
9
+ attr_reader :current_cursor
10
+
11
+ # Collection next cursor
12
+ attr_reader :next_cursor
13
+
14
+ # Applicant collection
15
+ attr_reader :applicants
16
+
17
+ def_delegators :applicants, :each, :map, :count, :size, :[]
18
+
19
+ #
20
+ # @param [Hash] data Raw applicant data
21
+ #
22
+ def initialize(data)
23
+ raw_data = Util.stringify_hash_keys data
24
+ pagination = raw_data['pagination']
25
+ if pagination.is_a? Hash
26
+ @current_cursor = pagination['current_cursor']
27
+ @next_cursor = pagination['next_cursor']
28
+ end
29
+ @applicants = raw_data['applicants'].map { |attr| Applicant.new attr }
30
+ end
31
+ end
32
+ end
@@ -1,3 +1,3 @@
1
1
  module Fountain
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fountain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - abrom
@@ -115,6 +115,7 @@ files:
115
115
  - lib/fountain/api/applicants.rb
116
116
  - lib/fountain/api/request_helper.rb
117
117
  - lib/fountain/applicant.rb
118
+ - lib/fountain/applicants.rb
118
119
  - lib/fountain/background_check.rb
119
120
  - lib/fountain/configuration.rb
120
121
  - lib/fountain/document_signature.rb