Class: IrcLB::Config
- Inherits:
-
Object
- Object
- IrcLB::Config
- Defined in:
- lib/irclb/config.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
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
#config ⇒ Object (readonly)
Returns the value of attribute config.
17 18 19 |
# File 'lib/irclb/config.rb', line 17 def config @config end |