Class: FaceDetect::Adapter::Google
- Inherits:
-
Object
- Object
- FaceDetect::Adapter::Google
- Defined in:
- lib/face_detect/adapter/google.rb,
lib/face_detect/adapter/google/service.rb,
lib/face_detect/adapter/google/auth_helper.rb
Defined Under Namespace
Modules: AuthHelper Classes: Service
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#initialize(file) ⇒ Google
constructor
A new instance of Google.
- #run ⇒ Object
Constructor Details
#initialize(file) ⇒ Google
Returns a new instance of Google.
9 10 11 |
# File 'lib/face_detect/adapter/google.rb', line 9 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
7 8 9 |
# File 'lib/face_detect/adapter/google.rb', line 7 def file @file end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/face_detect/adapter/google.rb', line 13 def run batch_response = execute response = batch_response.responses.first if response && response.face_annotations response.face_annotations.map do |annotation| convert_face(annotation) end else [] end end |