class Freighthop::Config
Public Class Methods
config()
click to toggle source
# File lib/freighthop/config.rb, line 10 def self.config @config ||= JSON.parse(file.read) end
exist?()
click to toggle source
# File lib/freighthop/config.rb, line 2 def self.exist? file.exist? end
fetch(*args)
click to toggle source
# File lib/freighthop/config.rb, line 14 def self.fetch(*args) config.fetch(*args) end
file()
click to toggle source
# File lib/freighthop/config.rb, line 6 def self.file Freighthop.host_root.join('.freighthop.json') end
write(config_hash)
click to toggle source
# File lib/freighthop/config.rb, line 18 def self.write(config_hash) file.open('w') { |f| f.puts(JSON.pretty_generate(config_hash)) } end