Class: FilterRename::Config
- Inherits:
-
Object
- Object
- FilterRename::Config
- Defined in:
- lib/filter_rename/config.rb
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
-
#global ⇒ Object
readonly
Returns the value of attribute global.
-
#macro ⇒ Object
readonly
Returns the value of attribute macro.
-
#words ⇒ Object
readonly
Returns the value of attribute words.
Instance Method Summary collapse
-
#initialize(global = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(global = {}) ⇒ Config
Returns a new instance of Config.
92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/filter_rename/config.rb', line 92 def initialize(global = {}) cfg = {filter: {}, global: {}, macro: {}, words: {}} load_file(File.(File.join(File.dirname(__FILE__), '..', 'filter_rename.yaml')), cfg) load_file(File.join(ENV['HOME'], '.filter_rename.yaml'), cfg) load_file(File.join(ENV['HOME'], '.filter_rename', 'config.yaml'), cfg) @filter = FilterConfig.new(cfg[:filter]) @global = GlobalConfig.new(cfg[:global].merge(global)) @macro = MacroConfig.new(cfg[:macro].sort) @words = WordsConfig.new(cfg[:words].sort) end |
Instance Attribute Details
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
90 91 92 |
# File 'lib/filter_rename/config.rb', line 90 def filter @filter end |
#global ⇒ Object (readonly)
Returns the value of attribute global.
90 91 92 |
# File 'lib/filter_rename/config.rb', line 90 def global @global end |
#macro ⇒ Object (readonly)
Returns the value of attribute macro.
90 91 92 |
# File 'lib/filter_rename/config.rb', line 90 def macro @macro end |
#words ⇒ Object (readonly)
Returns the value of attribute words.
90 91 92 |
# File 'lib/filter_rename/config.rb', line 90 def words @words end |