Class: FilterRename::GlobalConfig
- Inherits:
-
Object
- Object
- FilterRename::GlobalConfig
- Defined in:
- lib/filter_rename/config.rb
Instance Attribute Summary collapse
-
#counter_length ⇒ Object
readonly
Returns the value of attribute counter_length.
-
#counter_start ⇒ Object
readonly
Returns the value of attribute counter_start.
-
#date_format ⇒ Object
readonly
Returns the value of attribute date_format.
-
#hash_if_exists ⇒ Object
readonly
Returns the value of attribute hash_if_exists.
-
#hash_on_tags ⇒ Object
readonly
Returns the value of attribute hash_on_tags.
-
#hash_type ⇒ Object
readonly
Returns the value of attribute hash_type.
-
#image_metadata ⇒ Object
readonly
Returns the value of attribute image_metadata.
-
#mp3_metadata ⇒ Object
readonly
Returns the value of attribute mp3_metadata.
-
#pdf_metadata ⇒ Object
readonly
Returns the value of attribute pdf_metadata.
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
Instance Method Summary collapse
-
#initialize(cfg) ⇒ GlobalConfig
constructor
A new instance of GlobalConfig.
Constructor Details
#initialize(cfg) ⇒ GlobalConfig
Returns a new instance of GlobalConfig.
59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/filter_rename/config.rb', line 59 def initialize(cfg) @date_format = cfg[:date_format] || '%Y-%m-%d' @hash_type = cfg[:hash_type].to_sym || :md5 = cfg[:hash_on_tags] || false @hash_if_exists = cfg[:hash_if_exists] || false @counter_length = cfg[:counter_length] || 4 @counter_start = cfg[:counter_start] || 0 @targets = cfg[:targets].to_sym || :short = cfg[:pdf_metadata].nil? ? true : cfg[:pdf_metadata].to_boolean = cfg[:image_metadata].nil? ? true : cfg[:image_metadata].to_boolean = cfg[:mp3_metadata].nil? ? true : cfg[:mp3_metadata].to_boolean end |
Instance Attribute Details
#counter_length ⇒ Object (readonly)
Returns the value of attribute counter_length.
56 57 58 |
# File 'lib/filter_rename/config.rb', line 56 def counter_length @counter_length end |
#counter_start ⇒ Object (readonly)
Returns the value of attribute counter_start.
56 57 58 |
# File 'lib/filter_rename/config.rb', line 56 def counter_start @counter_start end |
#date_format ⇒ Object (readonly)
Returns the value of attribute date_format.
56 57 58 |
# File 'lib/filter_rename/config.rb', line 56 def date_format @date_format end |
#hash_if_exists ⇒ Object (readonly)
Returns the value of attribute hash_if_exists.
56 57 58 |
# File 'lib/filter_rename/config.rb', line 56 def hash_if_exists @hash_if_exists end |
#hash_on_tags ⇒ Object (readonly)
Returns the value of attribute hash_on_tags.
56 57 58 |
# File 'lib/filter_rename/config.rb', line 56 def end |
#hash_type ⇒ Object (readonly)
Returns the value of attribute hash_type.
56 57 58 |
# File 'lib/filter_rename/config.rb', line 56 def hash_type @hash_type end |
#image_metadata ⇒ Object (readonly)
Returns the value of attribute image_metadata.
56 57 58 |
# File 'lib/filter_rename/config.rb', line 56 def end |
#mp3_metadata ⇒ Object (readonly)
Returns the value of attribute mp3_metadata.
56 57 58 |
# File 'lib/filter_rename/config.rb', line 56 def end |
#pdf_metadata ⇒ Object (readonly)
Returns the value of attribute pdf_metadata.
56 57 58 |
# File 'lib/filter_rename/config.rb', line 56 def end |
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
56 57 58 |
# File 'lib/filter_rename/config.rb', line 56 def targets @targets end |