Class: EhbrsRubyUtils::Vg::Patchers::TempFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/ehbrs_ruby_utils/vg/patchers/temp_files.rb

Instance Method Summary collapse

Instance Method Details

#inputObject



9
10
11
# File 'lib/ehbrs_ruby_utils/vg/patchers/temp_files.rb', line 9

def input
  swaped? ? temp0 : initial
end

#move_result_to(dest) ⇒ Object



13
14
15
16
17
# File 'lib/ehbrs_ruby_utils/vg/patchers/temp_files.rb', line 13

def move_result_to(dest)
  return unless swaped?

  ::FileUtils.mv(temp0.to_path, dest.to_path)
end

#outputObject



19
20
21
# File 'lib/ehbrs_ruby_utils/vg/patchers/temp_files.rb', line 19

def output
  temp1
end

#swapObject



23
24
25
26
27
28
# File 'lib/ehbrs_ruby_utils/vg/patchers/temp_files.rb', line 23

def swap
  temp0_current = temp0
  self.temp0 = temp1
  self.temp1 = temp0_current
  @swaped = true
end

#swaped?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/ehbrs_ruby_utils/vg/patchers/temp_files.rb', line 30

def swaped?
  @swaped ? true : false
end