Class: SflowConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSflowConfig

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

#daemonizeObject (readonly)

Returns the value of attribute daemonize.



5
6
7
# File 'lib/sflow/lib/sflow/config.rb', line 5

def daemonize
  @daemonize
end

#logstash_hostObject (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_portObject (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_hashObject (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