Class: LinkedImageStrategy
- Inherits:
-
Object
- Object
- LinkedImageStrategy
- Defined in:
- lib/ralbum/image_strategies/linked_image_strategy.rb
Overview
Create a link from inpath to outpath
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #build(inpath, outpath) ⇒ Object
-
#initialize(name) ⇒ LinkedImageStrategy
constructor
A new instance of LinkedImageStrategy.
Constructor Details
#initialize(name) ⇒ LinkedImageStrategy
Returns a new instance of LinkedImageStrategy.
8 9 10 |
# File 'lib/ralbum/image_strategies/linked_image_strategy.rb', line 8 def initialize( name ) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/ralbum/image_strategies/linked_image_strategy.rb', line 6 def name @name end |
Instance Method Details
#build(inpath, outpath) ⇒ Object
12 13 14 15 16 |
# File 'lib/ralbum/image_strategies/linked_image_strategy.rb', line 12 def build( inpath, outpath ) return if File.exist?( outpath ) ralbum_verbose( 1, "link " ) File.symlink( inpath, outpath ) end |