Class: CherryPickingMoments::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/cherry_picking_moments/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filepath) ⇒ Image

Returns a new instance of Image.



7
8
9
# File 'lib/cherry_picking_moments/image.rb', line 7

def initialize(filepath)
  @filepath = filepath
end

Instance Attribute Details

#filepathObject (readonly)

Returns the value of attribute filepath.



4
5
6
# File 'lib/cherry_picking_moments/image.rb', line 4

def filepath
  @filepath
end

#following_distanceObject

Returns the value of attribute following_distance.



5
6
7
# File 'lib/cherry_picking_moments/image.rb', line 5

def following_distance
  @following_distance
end

Instance Method Details

#distance_from(image) ⇒ Object



11
12
13
# File 'lib/cherry_picking_moments/image.rb', line 11

def distance_from(image)
  phashion_image.distance_from(image.phashion_image)
end

#phashion_imageObject



15
16
17
# File 'lib/cherry_picking_moments/image.rb', line 15

def phashion_image
  @phashion_image ||= Phashion::Image.new(@filepath)
end