Method: LearnableNotifier#initialize

Defined in:
lib/learnable-notifier.rb

#initialize(rss_path, api_key, options = {}) ⇒ LearnableNotifier



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/learnable-notifier.rb', line 10

def initialize(rss_path, api_key, options = {})
  self.rss_path = rss_path
  self.options = {
    :application => 'Learnable forum',
    :storage => File.join(ENV['HOME'], '.learnable-notifier')
  }.merge(options)

  Prowler.configure do |config|
    config.api_key = api_key
    config.application = self.options[:application]
  end

  self.sent = { self.rss_path => [] }
  if (File.exists?(self.options[:storage]) && yaml = YAML.load_file(self.options[:storage]))
    self.sent = yaml
  end
end