Class: BBMB::Util::PollingManager

Inherits:
Object
  • Object
show all
Defined in:
lib/bbmb/util/polling_manager.rb

Instance Method Summary collapse

Instance Method Details

#load_sources(&block) ⇒ Object



120
121
122
123
124
125
126
127
# File 'lib/bbmb/util/polling_manager.rb', line 120

def load_sources(&block)
  file = File.open(BBMB.config.polling_file)
  YAML.load_documents(file) { |mission|
    block.call(mission)
  }
ensure
  file.close if(file)
end

#poll_sources(&block) ⇒ Object



128
129
130
131
132
# File 'lib/bbmb/util/polling_manager.rb', line 128

def poll_sources(&block)
  load_sources { |source|
    source.poll(&block)
  }
end