Class: FilterRename::GlobalConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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
  @hash_on_tags = 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_lengthObject (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_startObject (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_formatObject (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_existsObject (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_tagsObject (readonly)

Returns the value of attribute hash_on_tags.



56
57
58
# File 'lib/filter_rename/config.rb', line 56

def hash_on_tags
  @hash_on_tags
end

#hash_typeObject (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_metadataObject (readonly)

Returns the value of attribute image_metadata.



56
57
58
# File 'lib/filter_rename/config.rb', line 56

def 
  
end

#mp3_metadataObject (readonly)

Returns the value of attribute mp3_metadata.



56
57
58
# File 'lib/filter_rename/config.rb', line 56

def 
  
end

#pdf_metadataObject (readonly)

Returns the value of attribute pdf_metadata.



56
57
58
# File 'lib/filter_rename/config.rb', line 56

def 
  
end

#targetsObject (readonly)

Returns the value of attribute targets.



56
57
58
# File 'lib/filter_rename/config.rb', line 56

def targets
  @targets
end