Class: SflowConfig
- Inherits:
-
Object
- Object
- SflowConfig
- Defined in:
- lib/sflow/lib/sflow/config.rb
Instance Attribute Summary collapse
-
#daemonize ⇒ Object
readonly
Returns the value of attribute daemonize.
-
#logstash_host ⇒ Object
readonly
Returns the value of attribute logstash_host.
-
#logstash_port ⇒ Object
readonly
Returns the value of attribute logstash_port.
-
#switch_hash ⇒ Object
readonly
Returns the value of attribute switch_hash.
Instance Method Summary collapse
-
#initialize ⇒ SflowConfig
constructor
A new instance of SflowConfig.
Constructor Details
#initialize ⇒ SflowConfig
Returns a new instance of SflowConfig.
7 8 9 10 11 12 13 |
# File 'lib/sflow/lib/sflow/config.rb', line 7 def initialize config = YAML.load_file("etc/config.yaml") @switch_hash = config['switch'] @logstash_host = config['logstash_host'] @logstash_port = config['logstash_port'] @daemonize = config['daemonize'] end |
Instance Attribute Details
#daemonize ⇒ Object (readonly)
Returns the value of attribute daemonize.
5 6 7 |
# File 'lib/sflow/lib/sflow/config.rb', line 5 def daemonize @daemonize end |
#logstash_host ⇒ Object (readonly)
Returns the value of attribute logstash_host.
3 4 5 |
# File 'lib/sflow/lib/sflow/config.rb', line 3 def logstash_host @logstash_host end |
#logstash_port ⇒ Object (readonly)
Returns the value of attribute logstash_port.
4 5 6 |
# File 'lib/sflow/lib/sflow/config.rb', line 4 def logstash_port @logstash_port end |
#switch_hash ⇒ Object (readonly)
Returns the value of attribute switch_hash.
2 3 4 |
# File 'lib/sflow/lib/sflow/config.rb', line 2 def switch_hash @switch_hash end |