Class: Proz::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/proz/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:) ⇒ Client



10
11
12
# File 'lib/proz/client.rb', line 10

def initialize(key:)
  @key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



9
10
11
# File 'lib/proz/client.rb', line 9

def key
  @key
end

Instance Method Details

#freelancer(uuid) ⇒ Object



14
15
16
# File 'lib/proz/client.rb', line 14

def freelancer(uuid)
  self.class.get("/freelancer/#{uuid}", headers: { 'X-Proz-API-Key' => key})['data']
end

#freelancer_matches(language_pair, options) ⇒ Object



18
19
20
21
# File 'lib/proz/client.rb', line 18

def freelancer_matches(language_pair, options)
  all_options = language_pair.merge!(options)
  self.class.get("/freelancer-matches", query: all_options, headers: { 'X-Proz-API-Key' => key})['data']
end