Class: Renamr::OmitAction

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

Overview

Omits file names shorter than limit.

Instance Method Summary collapse

Methods inherited from Action

#p2m, #set

Constructor Details

#initialize(lim) ⇒ OmitAction

Returns a new instance of OmitAction.



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

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

  @lim = lim
end

Instance Method Details

#do(src) ⇒ Object



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

def do(src)
  src.length < @lim ? nil : src
end