Class: Icarus::Mod::Config

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

Overview

Reads the configuration file

Class Method Summary collapse

Class Method Details

.configObject



10
11
12
13
14
# File 'lib/icarus/mod/config.rb', line 10

def config
  return @config if @config

  read
end

.firebaseObject



20
21
22
# File 'lib/icarus/mod/config.rb', line 20

def firebase
  @config.firebase
end

.githubObject



24
25
26
# File 'lib/icarus/mod/config.rb', line 24

def github
  @config.github
end

.read(config_file = self.config_file) ⇒ Object



16
17
18
# File 'lib/icarus/mod/config.rb', line 16

def read(config_file = self.config_file)
  @config = JSON.parse(File.read(config_file), object_class: OpenStruct)
end