Class: Utopia::Gallery::Process

Inherits:
Object
  • Object
show all
Defined in:
lib/utopia/gallery/process.rb

Direct Known Subclasses

ResizeImage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Process

Returns a new instance of Process.



27
28
29
# File 'lib/utopia/gallery/process.rb', line 27

def initialize(name)
  @name = name.to_sym
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



31
32
33
# File 'lib/utopia/gallery/process.rb', line 31

def name
  @name
end

Instance Method Details

#fresh?(input_path, output_path) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/utopia/gallery/process.rb', line 39

def fresh?(input_path, output_path)
  return File.exist?(output_path) && File.mtime(input_path) < File.mtime(output_path)
end

#relative_path(media) ⇒ Object



33
34
35
36
37
# File 'lib/utopia/gallery/process.rb', line 33

def relative_path(media)
  source_path = media.path
  
  File.join(File.dirname(source_path), @name.to_s, File.basename(source_path))
end