Class: FileRenamer::ParamsCorrector

Inherits:
Object
  • Object
show all
Defined in:
lib/params_corrector.rb

Constant Summary collapse

SLASH =
Gem.win_platform? ? '\\' : '/'
FILENAME_REGEXP =
/^[a-zA-Z_0-9-]+$/.freeze
EXTENSION_REGEXP =
/^[a-zA-Z0-9_.]{1,6}$/.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParamsCorrector

Returns a new instance of ParamsCorrector.



11
12
13
# File 'lib/params_corrector.rb', line 11

def initialize
  @params
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



9
10
11
# File 'lib/params_corrector.rb', line 9

def params
  @params
end

Instance Method Details

#corrected_params(params) ⇒ Object



15
16
17
18
19
# File 'lib/params_corrector.rb', line 15

def corrected_params(params)
  init_params(params)
  params_correction!
  self.params
end

#init_params(params) ⇒ Object



21
22
23
# File 'lib/params_corrector.rb', line 21

def init_params(params)
  self.params = params
end