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



24
25
26
# File 'lib/cb/responses/Recommendation/recommendations.rb', line 24

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

#hash_containing_metadataObject



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

def 
  nil
end

#root_nodeObject



28
29
30
# File 'lib/cb/responses/Recommendation/recommendations.rb', line 28

def root_node
  'data'
end

#validate_api_hashObject



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

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