Class: Fountain::Applicants
- Inherits:
-
Object
- Object
- Fountain::Applicants
- Extended by:
- Forwardable
- Defined in:
- lib/fountain/applicants.rb
Overview
Fountain Applicant collection
Instance Attribute Summary collapse
-
#applicants ⇒ Object
readonly
Applicant collection.
-
#current_cursor ⇒ Object
readonly
Collection current cursor.
-
#next_cursor ⇒ Object
readonly
Collection next cursor.
Instance Method Summary collapse
-
#initialize(data) ⇒ Applicants
constructor
A new instance of Applicants.
- #inspect ⇒ Object
Constructor Details
#initialize(data) ⇒ Applicants
Returns a new instance of Applicants.
24 25 26 27 28 29 30 31 32 |
# File 'lib/fountain/applicants.rb', line 24 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
#applicants ⇒ Object (readonly)
Applicant collection
17 18 19 |
# File 'lib/fountain/applicants.rb', line 17 def applicants @applicants end |
#current_cursor ⇒ Object (readonly)
Collection current cursor
11 12 13 |
# File 'lib/fountain/applicants.rb', line 11 def current_cursor @current_cursor end |
#next_cursor ⇒ Object (readonly)
Collection next cursor
14 15 16 |
# File 'lib/fountain/applicants.rb', line 14 def next_cursor @next_cursor end |
Instance Method Details
#inspect ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/fountain/applicants.rb', line 34 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 |