Class: Proz::FreelancerMatches
- Inherits:
-
Object
- Object
- Proz::FreelancerMatches
- Includes:
- HTTParty
- Defined in:
- lib/proz/freelancer_matches.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#language_pair ⇒ Object
readonly
Returns the value of attribute language_pair.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #freelancer_matches ⇒ Object
-
#initialize(key:, language_pair:, **options) ⇒ FreelancerMatches
constructor
A new instance of FreelancerMatches.
Constructor Details
#initialize(key:, language_pair:, **options) ⇒ FreelancerMatches
Returns a new instance of FreelancerMatches.
8 9 10 11 12 |
# File 'lib/proz/freelancer_matches.rb', line 8 def initialize(key:, language_pair:, **) @key = key @language_pair = { language_pair: language_pair } @options = end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/proz/freelancer_matches.rb', line 7 def key @key end |
#language_pair ⇒ Object (readonly)
Returns the value of attribute language_pair.
7 8 9 |
# File 'lib/proz/freelancer_matches.rb', line 7 def language_pair @language_pair end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/proz/freelancer_matches.rb', line 7 def @options end |
Instance Method Details
#freelancer_matches ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/proz/freelancer_matches.rb', line 14 def freelancer_matches case when freelancer_matches_response.has_key?('error') if freelancer_matches_response['error'].eql?('invalid_api_key') raise 'Invalid API Key' else raise 'Invalid Request' end when freelancer_matches_response.has_key?('meta') if freelancer_matches_response['meta']['num_results'].eql?(0) {} else freelancer_matches_response['data'] end else freelancer_matches_response['data'] end end |