Class: Utopia::Gallery::Process
- Inherits:
-
Object
- Object
- Utopia::Gallery::Process
- Defined in:
- lib/utopia/gallery/process.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #fresh?(input_path, output_path) ⇒ Boolean
-
#initialize(name) ⇒ Process
constructor
A new instance of Process.
- #relative_path(media) ⇒ Object
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
#name ⇒ Object (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
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 |