Class: Eve::Base
Direct Known Subclasses
Constant Summary collapse
- VALID_KEYS =
[:characterID, :keyID, :vCode]
Instance Method Summary collapse
Instance Method Details
#configure ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/eve/base.rb', line 25 def configure config = load_config query = {} config.each do |k,v| query[k.to_sym] = v if VALID_KEYS.include? k.to_sym end query end |
#load_config ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/eve/base.rb', line 11 def load_config config = {} begin config = YAML.load(File.read(File.('~/.eve-api'))) rescue Errno::ENOENT raise "No ~/.eve-api config. The skill queue monitor can't start..." rescue Psych::SyntaxError raise "Invalid syntax in ~/.eve-api. The skill queue monitor can't start..." end config end |
#parse_date(eve_date) ⇒ Object
40 41 42 |
# File 'lib/eve/base.rb', line 40 def parse_date(eve_date) DateTime.strptime(eve_date, '%Y-%m-%d %H:%M:%S') rescue nil end |
#query ⇒ Object
36 37 38 |
# File 'lib/eve/base.rb', line 36 def query @query ||= configure end |