Class: GradesFirst::Config

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

def initialize
  Dotenv.load(*GradesFirst::Config.load_paths)
end

Class Method Details

.load_pathsObject



9
10
11
# File 'lib/gradesfirst/config.rb', line 9

def self.load_paths
  @@load_paths ||= [".env", "~/.env", ".env.master"]
end

.load_paths=(paths) ⇒ Object



13
14
15
# File 'lib/gradesfirst/config.rb', line 13

def self.load_paths=(paths)
  @@load_paths = paths
end

Instance Method Details

#code_talkersObject



17
18
19
# File 'lib/gradesfirst/config.rb', line 17

def code_talkers
  ENV["GF_CODE_TALKERS"].to_s.split("|")
end

#day_zeroObject



21
22
23
24
25
26
27
# File 'lib/gradesfirst/config.rb', line 21

def day_zero
  if ENV["GF_DAY_ZERO"].nil?
    Time.now
  else
    Time.parse(ENV["GF_DAY_ZERO"])
  end
end

#developersObject



29
30
31
# File 'lib/gradesfirst/config.rb', line 29

def developers
  ENV["GF_DEVELOPERS"].to_s.split("|")
end