Class: Buddhy::Config
- Inherits:
-
Object
- Object
- Buddhy::Config
- Defined in:
- lib/buddhy/config.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#name ⇒ Object
Returns the value of attribute name.
-
#nick ⇒ Object
Returns the value of attribute nick.
-
#server ⇒ Object
Returns the value of attribute server.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
6 7 8 |
# File 'lib/buddhy/config.rb', line 6 def channel @channel end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/buddhy/config.rb', line 6 def name @name end |
#nick ⇒ Object
Returns the value of attribute nick.
6 7 8 |
# File 'lib/buddhy/config.rb', line 6 def nick @nick end |
#server ⇒ Object
Returns the value of attribute server.
6 7 8 |
# File 'lib/buddhy/config.rb', line 6 def server @server end |
Class Method Details
.load ⇒ Object
8 9 10 |
# File 'lib/buddhy/config.rb', line 8 def self.load new.read_yaml end |
Instance Method Details
#read_yaml ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/buddhy/config.rb', line 12 def read_yaml root = File.('../../..', __FILE__) file = File.join(root, 'config', 'buddhy.yml') hash = YAML.load(File.read(file)) @nick = hash[:nick] @name = hash[:name] @server = hash[:server] @channel = hash[:channel] self end |