Class: Renamr::PrependAction

Inherits:
Action
  • Object
show all
Defined in:
lib/renamr/prepend.rb

Overview

Prepends user patter.

Instance Method Summary collapse

Methods inherited from Action

#p2m, #set

Constructor Details

#initialize(pat) ⇒ PrependAction

Returns a new instance of PrependAction.



11
12
13
14
15
# File 'lib/renamr/prepend.rb', line 11

def initialize(pat)
  raise 'pat cannot be nil.' if pat.nil?

  @pat = pat
end

Instance Method Details

#do(src) ⇒ Object



17
18
19
# File 'lib/renamr/prepend.rb', line 17

def do(src)
  src.prepend(@pat)
end