Class: FileMonitor::Configuration
- Inherits:
-
Object
- Object
- FileMonitor::Configuration
- Defined in:
- lib/file_monitor/configuration.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#logfile_path ⇒ Object
Returns the value of attribute logfile_path.
-
#watch_dir ⇒ Object
Returns the value of attribute watch_dir.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(*args) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 |
# File 'lib/file_monitor/configuration.rb', line 5 def initialize *args = args.last.is_a?(Hash) ? args.pop : {} config_path = [:config_path] config_content = ::File.exist?(config_path.to_s) ? YAML.load_file(config_path) : {"logfile" => {}, "monitor" => {}} @data = config_content end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/file_monitor/configuration.rb', line 4 def data @data end |
#logfile_path ⇒ Object
Returns the value of attribute logfile_path.
3 4 5 |
# File 'lib/file_monitor/configuration.rb', line 3 def logfile_path @logfile_path end |
#watch_dir ⇒ Object
Returns the value of attribute watch_dir.
3 4 5 |
# File 'lib/file_monitor/configuration.rb', line 3 def watch_dir @watch_dir end |