Module: UriService::Client::Requests::Vocabularies

Included in:
Connection
Defined in:
lib/uri_service/client/requests/vocabularies.rb

Instance Method Summary collapse

Instance Method Details

#create_vocabulary(vocabulary = {}) ⇒ Object



13
14
15
# File 'lib/uri_service/client/requests/vocabularies.rb', line 13

def create_vocabulary(vocabulary = {})
  request(:post, '/vocabularies', body: vocabulary)
end

#delete_vocabulary(string_key) ⇒ Object



22
23
24
# File 'lib/uri_service/client/requests/vocabularies.rb', line 22

def delete_vocabulary(string_key)
  request(:delete, "/vocabularies/#{string_key}")
end

#update_vocabulary(vocabulary = {}) ⇒ Object



17
18
19
20
# File 'lib/uri_service/client/requests/vocabularies.rb', line 17

def update_vocabulary(vocabulary = {})
  string_key = vocabulary.delete(:string_key) || vocabulary.delete('string_key')
  request(:patch, "/vocabularies/#{string_key}", body: vocabulary)
end

#vocabularies(params = {}) ⇒ Object



5
6
7
# File 'lib/uri_service/client/requests/vocabularies.rb', line 5

def vocabularies(params = {})
  request(:get, '/vocabularies', params: params)
end

#vocabulary(string_key) ⇒ Object



9
10
11
# File 'lib/uri_service/client/requests/vocabularies.rb', line 9

def vocabulary(string_key)
  request(:get, "/vocabularies/#{string_key}")
end