Class: Bueda::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(apikey) ⇒ Client

Returns a new instance of Client.



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

def initialize(apikey)
  self.class.default_params :apikey => apikey
end

Instance Method Details

#categories(tags, options = {}) ⇒ Object



22
23
24
25
# File 'lib/bueda/client.rb', line 22

def categories(tags, options={})
  options.merge!(:query => {:tags => tags.join(',')})
  self.class.get('/categories', options)['result']
end

#concepts(tags, options = {}) ⇒ Object



32
33
34
35
# File 'lib/bueda/client.rb', line 32

def concepts(tags, options={})
  options.merge!({:tags => tags})
  self.class.get('/semantics', options)['result']
end

#enriched(tags, options = {}) ⇒ Object



17
18
19
20
# File 'lib/bueda/client.rb', line 17

def enriched(tags, options={})
  options.merge!(:query => {:tags => tags.join(',')})
  self.class.get('/enriched', options)['result']
end

#split(tags, options = {}) ⇒ Object



27
28
29
30
# File 'lib/bueda/client.rb', line 27

def split(tags, options={})
  options.merge!({:tags => tags})
  self.class.get('/separated', options)['result']
end

#versionObject



13
14
15
# File 'lib/bueda/client.rb', line 13

def version()
  self.class.get('/version')
end