Class: FaceDetect::Adapter::Google::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/face_detect/adapter/google/service.rb

Constant Summary collapse

Vision =
::Google::Apis::VisionV1

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorization, file) ⇒ Service

Returns a new instance of Service.



13
14
15
16
# File 'lib/face_detect/adapter/google/service.rb', line 13

def initialize(authorization, file)
  @authorization = authorization
  @file = file
end

Instance Attribute Details

#authorizationObject (readonly)

Returns the value of attribute authorization.



11
12
13
# File 'lib/face_detect/adapter/google/service.rb', line 11

def authorization
  @authorization
end

#fileObject (readonly)

Returns the value of attribute file.



11
12
13
# File 'lib/face_detect/adapter/google/service.rb', line 11

def file
  @file
end

Instance Method Details

#runObject



18
19
20
21
# File 'lib/face_detect/adapter/google/service.rb', line 18

def run
  service.authorization = authorization
  service.annotate_image(batch_request, fields: fields)
end