Class: Pina::ProcessedDocument

Inherits:
Object
  • Object
show all
Defined in:
lib/pina/processed_document.rb

Class Method Summary collapse

Class Method Details

.all(page = nil) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/pina/processed_document.rb', line 29

def all(page = nil)
  response = Pina::RestAdapter.get(:processed_documents, page)

  return Pina::Collections::ProcessedDocument.new(attributes(response)) if
    response.ok?

  response
end

.delete(id) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/pina/processed_document.rb', line 38

def delete(id)
  response = Pina::RestAdapter.delete(:processed_documents, id)

  return Pina::Models::ProcessedDocument.new(attributes(response)) if
    response.ok?

  response
end

.find(id) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/pina/processed_document.rb', line 11

def find(id)
  response = Pina::RestAdapter.get(:processed_documents, id)

  return Pina::Models::ProcessedDocument.new(attributes(response)) if
    response.ok?

  response
end

.new(params = nil) ⇒ Object



7
8
9
# File 'lib/pina/processed_document.rb', line 7

def new(params = nil)
  Pina::Models::ProcessedDocument.new(params)
end

.where(hash, page = nil) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/pina/processed_document.rb', line 20

def where(hash, page = nil)
  response = Pina::RestAdapter.get(:processed_documents, hash)

  return Pina::Collections::ProcessedDocument.new(attributes(response)) if
    response.ok?

  response
end