Class: Fountain::Applicants

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/fountain/applicants.rb

Overview

Fountain Applicant collection

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Applicants

Returns a new instance of Applicants.

Parameters:

  • data (Hash)

    Raw applicant data



22
23
24
25
26
27
28
29
30
# File 'lib/fountain/applicants.rb', line 22

def initialize(data)
  raw_data = Util.stringify_hash_keys data
  pagination = raw_data['pagination']
  if pagination.is_a? Hash
    @current_cursor = pagination['current_cursor']
    @next_cursor = pagination['next_cursor']
  end
  @applicants = raw_data['applicants'].map { |attr| Applicant.new attr }
end

Instance Attribute Details

#applicantsObject (readonly)

Applicant collection



15
16
17
# File 'lib/fountain/applicants.rb', line 15

def applicants
  @applicants
end

#current_cursorObject (readonly)

Collection current cursor



9
10
11
# File 'lib/fountain/applicants.rb', line 9

def current_cursor
  @current_cursor
end

#next_cursorObject (readonly)

Collection next cursor



12
13
14
# File 'lib/fountain/applicants.rb', line 12

def next_cursor
  @next_cursor
end

Instance Method Details

#inspectObject



32
33
34
35
36
37
38
39
# File 'lib/fountain/applicants.rb', line 32

def inspect
  format(
    '#<%<class_name>s:0x%<object_id>p @count="%<count>s">',
    class_name: self.class.name,
    object_id: object_id,
    count: count
  )
end