Class: TorrentRSS::Config
- Inherits:
-
Object
- Object
- TorrentRSS::Config
- Defined in:
- lib/torrent_rss/config.rb
Class Attribute Summary collapse
-
.config_file ⇒ Object
Returns the value of attribute config_file.
Class Method Summary collapse
Class Attribute Details
.config_file ⇒ Object
Returns the value of attribute config_file.
6 7 8 |
# File 'lib/torrent_rss/config.rb', line 6 def config_file @config_file end |
Class Method Details
.config_data ⇒ Object
15 16 17 |
# File 'lib/torrent_rss/config.rb', line 15 def config_data @config_data ||= read_config end |
.directory ⇒ Object
7 8 9 |
# File 'lib/torrent_rss/config.rb', line 7 def directory config_data['directory'] end |
.feeds ⇒ Object
11 12 13 |
# File 'lib/torrent_rss/config.rb', line 11 def feeds config_data['feeds'] end |
.read_config ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/torrent_rss/config.rb', line 19 def read_config if File.exists? config_file TOML.load_file config_file else {} end end |