Class: Ingenia::Bundle

Inherits:
Object
  • Object
show all
Includes:
Api
Defined in:
lib/ingenia_api/bundle.rb

Constant Summary collapse

PATH =
'/bundles'
BUNDLE_KNOWN_PARAMS =

These are known request params, all other params will go inside the json object

%i{ full_text offset limit }

Constants included from Api

Api::API_KNOWN_PARAMS

Class Method Summary collapse

Methods included from Api

#api_key, #api_key=, #classify, #debug=, #endpoint=, #similar_to, #status, #summarize, #train, #trained_tags, #verify_response, #version=

Class Method Details

.all(params = {}) ⇒ Object

Index your bundles



38
39
40
41
42
43
44
# File 'lib/ingenia_api/bundle.rb', line 38

def self.all params = {}
  initialize_params params

  Ingenia::Api.verify_response do
    Remote.get(PATH, @params )
  end
end

.create(params = {}) ⇒ Object

Create a new bundle



19
20
21
22
23
24
25
# File 'lib/ingenia_api/bundle.rb', line 19

def self.create params = {}
  initialize_params params

  Ingenia::Api.verify_response do
    Remote.post(PATH, @params )
  end
end

.destroy(id) ⇒ Object



46
47
48
49
50
# File 'lib/ingenia_api/bundle.rb', line 46

def self.destroy id
  Ingenia::Api.verify_response do
    Remote.delete("#{PATH}/#{id}", :params => { :api_key => Ingenia::Api.api_key} )
  end
end

.get(id, params = {}) ⇒ Object

Get a single bundle by id



10
11
12
13
14
15
16
# File 'lib/ingenia_api/bundle.rb', line 10

def self.get id, params = {}
  initialize_params params

  Ingenia::Api.verify_response do
    Remote.get "#{PATH}/#{id}", @params
  end
end

.update(id, params = {}) ⇒ Object

Update an existing bundle



28
29
30
31
32
33
34
# File 'lib/ingenia_api/bundle.rb', line 28

def self.update id, params = {}
  initialize_params params

  Ingenia::Api.verify_response do
    Remote.put("#{PATH}/#{id}", @params )
  end
end