Class: Avm::Files::Rotate

Inherits:
Object
  • Object
show all
Includes:
EacRubyUtils::SimpleCache
Defined in:
lib/avm/files/rotate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_path) ⇒ Rotate

Returns a new instance of Rotate.



13
14
15
# File 'lib/avm/files/rotate.rb', line 13

def initialize(source_path)
  @source_path = source_path
end

Instance Attribute Details

#source_pathObject (readonly)

Returns the value of attribute source_path.



11
12
13
# File 'lib/avm/files/rotate.rb', line 11

def source_path
  @source_path
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
# File 'lib/avm/files/rotate.rb', line 17

def run
  validate_msg = validate
  return validate_msg if validate_msg.present?

  ::FileUtils.mv(source_path, target_path)
  nil
end