Class: Cb::Responses::Recommendations

Inherits:
ApiResponse show all
Defined in:
lib/cb/responses/Recommendation/recommendations.rb

Instance Attribute Summary

Attributes inherited from ApiResponse

#models, #response

Instance Method Summary collapse

Methods inherited from ApiResponse

#initialize

Constructor Details

This class inherits a constructor from Cb::Responses::ApiResponse

Instance Method Details

#extract_modelsObject



15
16
17
# File 'lib/cb/responses/Recommendation/recommendations.rb', line 15

def extract_models
  response[root_node]['results'].map { |cur_job| Models::RecommendedJob.new(cur_job) }
end

#hash_containing_metadataObject



11
12
13
# File 'lib/cb/responses/Recommendation/recommendations.rb', line 11

def 
  nil
end

#root_nodeObject



19
20
21
# File 'lib/cb/responses/Recommendation/recommendations.rb', line 19

def root_node
  'data'
end

#validate_api_hashObject



5
6
7
8
9
# File 'lib/cb/responses/Recommendation/recommendations.rb', line 5

def validate_api_hash
  check_nonstandard_error_node(response)
  required_response_field(root_node, response)
  required_response_field('results', response[root_node])
end