Class: LinkedImageStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/ralbum/image_strategies/linked_image_strategy.rb

Overview

Create a link from inpath to outpath

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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