Class: FilterRename::FilterConfig
- Inherits:
-
Object
- Object
- FilterRename::FilterConfig
- Defined in:
- lib/filter_rename/config.rb
Instance Attribute Summary collapse
-
#grep ⇒ Object
Returns the value of attribute grep.
-
#grep_exclude ⇒ Object
Returns the value of attribute grep_exclude.
-
#grep_on ⇒ Object
Returns the value of attribute grep_on.
-
#grep_target ⇒ Object
Returns the value of attribute grep_target.
-
#ignore_case ⇒ Object
Returns the value of attribute ignore_case.
-
#lang ⇒ Object
Returns the value of attribute lang.
-
#number_separator ⇒ Object
Returns the value of attribute number_separator.
-
#occurrence_separator ⇒ Object
Returns the value of attribute occurrence_separator.
-
#target ⇒ Object
Returns the value of attribute target.
-
#word_separator ⇒ Object
Returns the value of attribute word_separator.
Instance Method Summary collapse
-
#initialize(cfg) ⇒ FilterConfig
constructor
A new instance of FilterConfig.
Constructor Details
#initialize(cfg) ⇒ FilterConfig
Returns a new instance of FilterConfig.
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/filter_rename/config.rb', line 77 def initialize(cfg) @word_separator = cfg[:word_separator] || ' ' @number_separator = cfg[:number_separator] || '.' @occurrence_separator = cfg[:occurrence_separator] || '-' @target = cfg[:target].to_sym || :name @ignore_case = cfg[:ignore_case].nil? ? true : cfg[:ignore_case].to_boolean @lang = (cfg[:lang] || :en).to_sym @macro = cfg[:macro] || {} @grep = cfg[:grep] || '.*' @grep_on = cfg[:grep_on].to_sym || :source @grep_exclude = cfg[:grep_exclude].to_boolean || false @grep_target = cfg[:grep_target].to_sym || :full_filename end |
Instance Attribute Details
#grep ⇒ Object
Returns the value of attribute grep.
75 76 77 |
# File 'lib/filter_rename/config.rb', line 75 def grep @grep end |
#grep_exclude ⇒ Object
Returns the value of attribute grep_exclude.
75 76 77 |
# File 'lib/filter_rename/config.rb', line 75 def grep_exclude @grep_exclude end |
#grep_on ⇒ Object
Returns the value of attribute grep_on.
75 76 77 |
# File 'lib/filter_rename/config.rb', line 75 def grep_on @grep_on end |
#grep_target ⇒ Object
Returns the value of attribute grep_target.
75 76 77 |
# File 'lib/filter_rename/config.rb', line 75 def grep_target @grep_target end |
#ignore_case ⇒ Object
Returns the value of attribute ignore_case.
75 76 77 |
# File 'lib/filter_rename/config.rb', line 75 def ignore_case @ignore_case end |
#lang ⇒ Object
Returns the value of attribute lang.
75 76 77 |
# File 'lib/filter_rename/config.rb', line 75 def lang @lang end |
#number_separator ⇒ Object
Returns the value of attribute number_separator.
75 76 77 |
# File 'lib/filter_rename/config.rb', line 75 def number_separator @number_separator end |
#occurrence_separator ⇒ Object
Returns the value of attribute occurrence_separator.
75 76 77 |
# File 'lib/filter_rename/config.rb', line 75 def occurrence_separator @occurrence_separator end |
#target ⇒ Object
Returns the value of attribute target.
75 76 77 |
# File 'lib/filter_rename/config.rb', line 75 def target @target end |
#word_separator ⇒ Object
Returns the value of attribute word_separator.
75 76 77 |
# File 'lib/filter_rename/config.rb', line 75 def word_separator @word_separator end |