Class: Feed2Mail::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



8
9
10
# File 'lib/feed2mail/config.rb', line 8

def initialize
  @feeds = []
end

Instance Attribute Details

#feedsObject (readonly)

Returns the value of attribute feeds.



5
6
7
# File 'lib/feed2mail/config.rb', line 5

def feeds
  @feeds
end

#hist_fileObject

Returns the value of attribute hist_file.



6
7
8
# File 'lib/feed2mail/config.rb', line 6

def hist_file
  @hist_file
end

#verboseObject

Returns the value of attribute verbose.



6
7
8
# File 'lib/feed2mail/config.rb', line 6

def verbose
  @verbose
end

Instance Method Details

#load(file = CONFIG_PATH) ⇒ Object



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

def load(file = CONFIG_PATH)
  @rc = YAML.load_file(File.expand_path(file))
  @rc['feeds'].each do |f|
    @feeds << Feed.new(f['uri'])
  end
end