Class: EhbrsRubyUtils::Fs::Selected::Build

Inherits:
Object
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/fs/selected/build.rb

Constant Summary collapse

DEFAULT_TARGET_BASENAME_PROC =
proc { |path| path.basename.to_path }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selected, target_dir, &target_basename_proc) ⇒ Build

Returns a new instance of Build.



14
15
16
17
18
# File 'lib/ehbrs_ruby_utils/fs/selected/build.rb', line 14

def initialize(selected, target_dir, &target_basename_proc)
  @selected = selected
  @target_dir = target_dir.to_pathname
  @target_basename_proc = target_basename_proc.presence || DEFAULT_TARGET_BASENAME_PROC
end

Instance Attribute Details

#selectedObject (readonly)

Returns the value of attribute selected.



12
13
14
# File 'lib/ehbrs_ruby_utils/fs/selected/build.rb', line 12

def selected
  @selected
end

#target_basename_procObject (readonly)

Returns the value of attribute target_basename_proc.



12
13
14
# File 'lib/ehbrs_ruby_utils/fs/selected/build.rb', line 12

def target_basename_proc
  @target_basename_proc
end

#target_dirObject (readonly)

Returns the value of attribute target_dir.



12
13
14
# File 'lib/ehbrs_ruby_utils/fs/selected/build.rb', line 12

def target_dir
  @target_dir
end

Instance Method Details

#performObject



20
21
22
23
# File 'lib/ehbrs_ruby_utils/fs/selected/build.rb', line 20

def perform
  clear_target_dir
  link_selected_found
end