Class: Snarl::SNP::Config
- Inherits:
-
Object
- Object
- Snarl::SNP::Config
- Defined in:
- lib/snarl/snp/config.rb
Defined Under Namespace
Classes: Normalize
Constant Summary collapse
- DEFAULT_HOST =
'127.0.0.1'
- DEFAULT_PORT =
9887
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
mainly for debug.
Instance Method Summary collapse
- #[](k) ⇒ Object
- #[]=(k, v) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #reset ⇒ Object
- #to_yaml ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
8 9 10 11 |
# File 'lib/snarl/snp/config.rb', line 8 def initialize @config = {} default_config end |
Instance Attribute Details
#config ⇒ Object (readonly)
mainly for debug
13 14 15 |
# File 'lib/snarl/snp/config.rb', line 13 def config @config end |
Instance Method Details
#[](k) ⇒ Object
22 |
# File 'lib/snarl/snp/config.rb', line 22 def [](k) ; @config[k.to_s] ; end |
#[]=(k, v) ⇒ Object
21 |
# File 'lib/snarl/snp/config.rb', line 21 def []=(k, v) ; Normalize.store(k, v, @config) ; end |
#reset ⇒ Object
23 |
# File 'lib/snarl/snp/config.rb', line 23 def reset ; @config = {} ; end |
#to_yaml ⇒ Object
24 |
# File 'lib/snarl/snp/config.rb', line 24 def to_yaml ; @config.to_yaml ; end |