Class: Cb::Models::CollapsedJobResults

Inherits:
Object
  • Object
show all
Defined in:
lib/cb/models/implementations/collapsed_job_results.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args_hash) ⇒ CollapsedJobResults

Returns a new instance of CollapsedJobResults.



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/cb/models/implementations/collapsed_job_results.rb', line 15

def initialize(args_hash)
  @args_hash = args_hash
  @last_item_index = args_hash['LastItemIndex']
  @search_location = args_hash['SearchMetaData']['SearchLocations']['SearchLocation'] rescue nil
  @grouping_parameter = args_hash['GroupedJobSearchResults']['GroupingParameter']
  @grouped_jobs = extract_collapsed_jobs(Cb::Utils::ResponseArrayExtractor.extract(args_hash['GroupedJobSearchResults'],
                                                                                   'SearchResults', 'JobSearchResultsGroup'))
  @total_pages = args_hash['TotalPages']
  @total_count = args_hash['TotalCount']
  @first_item_index = args_hash['FirstItemIndex']
  @last_item_index = args_hash['LastItemIndex']
end

Instance Attribute Details

#args_hashObject (readonly)

Returns the value of attribute args_hash.



14
15
16
# File 'lib/cb/models/implementations/collapsed_job_results.rb', line 14

def args_hash
  @args_hash
end

#first_item_indexObject (readonly)

Returns the value of attribute first_item_index.



14
15
16
# File 'lib/cb/models/implementations/collapsed_job_results.rb', line 14

def first_item_index
  @first_item_index
end

#grouped_jobsObject (readonly)

Returns the value of attribute grouped_jobs.



14
15
16
# File 'lib/cb/models/implementations/collapsed_job_results.rb', line 14

def grouped_jobs
  @grouped_jobs
end

#grouping_parameterObject (readonly)

Returns the value of attribute grouping_parameter.



14
15
16
# File 'lib/cb/models/implementations/collapsed_job_results.rb', line 14

def grouping_parameter
  @grouping_parameter
end

#last_item_indexObject (readonly)

Returns the value of attribute last_item_index.



14
15
16
# File 'lib/cb/models/implementations/collapsed_job_results.rb', line 14

def last_item_index
  @last_item_index
end

#search_locationObject (readonly)

Returns the value of attribute search_location.



14
15
16
# File 'lib/cb/models/implementations/collapsed_job_results.rb', line 14

def search_location
  @search_location
end

#total_countObject (readonly)

Returns the value of attribute total_count.



14
15
16
# File 'lib/cb/models/implementations/collapsed_job_results.rb', line 14

def total_count
  @total_count
end

#total_pagesObject (readonly)

Returns the value of attribute total_pages.



14
15
16
# File 'lib/cb/models/implementations/collapsed_job_results.rb', line 14

def total_pages
  @total_pages
end