Class: Findface::Face

Inherits:
Object
  • Object
show all
Defined in:
lib/findface/face.rb

Class Method Summary collapse

Class Method Details

.create(options) ⇒ Object

Endpoint: api.findface.pro/v0/face/ (POST) | Usage: FindFace::Face.create

Output: Creates a new face object


22
23
24
# File 'lib/findface/face.rb', line 22

def create options
  API::request(:post, 'face', options)
end

.delete(face_id) ⇒ Object

Endpoint: api.findface.pro/v0/face/id/:id (DELETE) | Usage: FindFace::Face.delete(face_id)

Output: Deletes a face with matching id


50
51
52
# File 'lib/findface/face.rb', line 50

def delete face_id
  API::request(:delete, "face/id/#{face_id}")
end

.delete_by_meta(meta_string) ⇒ Object

Endpoint: api.findface.pro/v0/face/meta/:meta_string (DELETE) | Usage: FindFace::Face.delete_by_meta(meta_string)

Output: Deletes a face with matching meta_string


57
58
59
# File 'lib/findface/face.rb', line 57

def delete_by_meta meta_string
  API::request(:delete, "face/meta/#{Findface.encode_meta_string(meta_string)}")
end

.details(face_id) ⇒ Object

Endpoint: api.findface.pro/v0/face/id/:id (GET) | Usage: FindFace::Face.details(face_id)

Output: Returns the details of a face with matching id


29
30
31
# File 'lib/findface/face.rb', line 29

def details face_id
  API::request(:get, "face/id/#{face_id}")
end

.details_by_meta(meta_string, pages = nil) ⇒ Object

Endpoint: api.findface.pro/v0/face/meta/:meta_string (GET) | Usage: FindFace::Face.details_by_meta(meta_string)

Output: Returns the details of an face with matching meta_string


36
37
38
# File 'lib/findface/face.rb', line 36

def details_by_meta meta_string, pages = nil
  Findface.get_list "face/meta/#{Findface.encode_meta_string(meta_string)}", pages
end

.list(pages = nil) ⇒ Object

Endpoint: api.findface.pro/v0/faces/ (GET) | Usage: FindFace::Face.list

Output: Returns list of faces


8
9
10
# File 'lib/findface/face.rb', line 8

def list pages = nil
  Findface.get_list 'faces', pages
end

.list_by_metaObject

Endpoint: api.findface.pro/v0/meta/ (GET) | Usage: FindFace::Face.list_by_meta

Output:  Returns list of faces with meta information


15
16
17
# File 'lib/findface/face.rb', line 15

def list_by_meta
  API::request(:get, 'meta')
end

.update(face_id, options) ⇒ Object

Endpoint: api.findface.pro/v0/face/id/:id (PUT) | Usage: FindFace::Face.update(face_id)

Output: Updates a face with matching id


43
44
45
# File 'lib/findface/face.rb', line 43

def update face_id, options
  API::request(:put, "face/id/#{face_id}", options)
end