Class: IrcLB::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



7
8
9
10
11
12
13
14
15
# File 'lib/irclb/config.rb', line 7

def initialize
  @filename = Pathname.new(Dir.home).join('.irclb.json')
  begin
    @config = JSON.parse(IO.read(@filename))
  rescue Errno::ENOENT => e
    puts "Was not able to load #{@filename}."
    exit(1)
  end
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



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

def config
  @config
end