Class: FeedNotifier::Config

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Config

Returns a new instance of Config.



20
21
22
23
# File 'lib/feed_notifier/config.rb', line 20

def initialize(attrs={})
  @feed_urls = []
  @interval  = 60*2
end

Instance Attribute Details

#feed_urlsObject

Returns the value of attribute feed_urls.



9
10
11
# File 'lib/feed_notifier/config.rb', line 9

def feed_urls
  @feed_urls
end

#intervalObject

Returns the value of attribute interval.



10
11
12
# File 'lib/feed_notifier/config.rb', line 10

def interval
  @interval
end

Class Method Details

.load(config_path) ⇒ Object



13
14
15
16
17
# File 'lib/feed_notifier/config.rb', line 13

def load(config_path)
  eval(File.read(config_path),binding)
rescue RuntimeError => e
  FeedNotifier.logger.error "error loading config file #{e.message}"
end

Instance Method Details

#log_pathObject



25
26
27
# File 'lib/feed_notifier/config.rb', line 25

def log_path
  STDOUT
end