class Sightengine::Api::FaceAttributes::Face
Attributes
attributes[RW]
celebrity[RW]
features[RW]
x1[RW]
x2[RW]
y1[RW]
y2[RW]
Public Class Methods
new(hash)
click to toggle source
# File lib/sightengine/api/face_attributes.rb, line 10 def initialize(hash) hash.each do |k, v| send("#{k}=", v) end end
Public Instance Methods
coordinates()
click to toggle source
# File lib/sightengine/api/face_attributes.rb, line 16 def coordinates [x1, y1, x2, y2] end
female?(min_prob = 0.8)
click to toggle source
# File lib/sightengine/api/face_attributes.rb, line 20 def female?(min_prob = 0.8) attributes["female"].to_f > min_prob end
male?(min_prob = 0.8)
click to toggle source
# File lib/sightengine/api/face_attributes.rb, line 24 def male?(min_prob = 0.8) attributes["male"].to_f > min_prob end
minor?(min_prob = 0.8)
click to toggle source
# File lib/sightengine/api/face_attributes.rb, line 28 def minor?(min_prob = 0.8) attributes["minor"].to_f > min_prob end
sunglasses?(min_prob = 0.8)
click to toggle source
# File lib/sightengine/api/face_attributes.rb, line 32 def sunglasses?(min_prob = 0.8) attributes["minor"].to_f > min_prob end