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



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

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

  @lim = lim
end

Instance Method Details

#do(src) ⇒ Object



19
20
21
# File 'lib/renamr/omit.rb', line 19

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