Class: FilterRename::Config
- Inherits:
-
Object
- Object
- FilterRename::Config
- Defined in:
- lib/filter_rename/config.rb
Overview
Proxy class for all configurations.
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.
268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/filter_rename/config.rb', line 268 def initialize(global = {}) cfg = { filter: {}, global: {}, macro: {}, words: {} } load_file(File.(File.join(File.dirname(__FILE__), "..", "filter_rename.yaml")), cfg) load_file(File.join(Dir.home, ".filter_rename.yaml"), cfg) load_file(File.join(Dir.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.
266 267 268 |
# File 'lib/filter_rename/config.rb', line 266 def filter @filter end |
#global ⇒ Object (readonly)
Returns the value of attribute global.
266 267 268 |
# File 'lib/filter_rename/config.rb', line 266 def global @global end |
#macro ⇒ Object (readonly)
Returns the value of attribute macro.
266 267 268 |
# File 'lib/filter_rename/config.rb', line 266 def macro @macro end |
#words ⇒ Object (readonly)
Returns the value of attribute words.
266 267 268 |
# File 'lib/filter_rename/config.rb', line 266 def words @words end |