Class: WifiWand::RuntimeConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/wifi_wand/runtime_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verbose: false, utc: false, out_stream: $stdout, err_stream: $stderr) ⇒ RuntimeConfig

Returns a new instance of RuntimeConfig.



8
9
10
11
12
13
# File 'lib/wifi_wand/runtime_config.rb', line 8

def initialize(verbose: false, utc: false, out_stream: $stdout, err_stream: $stderr)
  @verbose = !!verbose
  @utc = !!utc
  @out_stream = out_stream
  @err_stream = err_stream
end

Instance Attribute Details

#err_streamObject

Returns the value of attribute err_stream.



6
7
8
# File 'lib/wifi_wand/runtime_config.rb', line 6

def err_stream
  @err_stream
end

#out_streamObject

Returns the value of attribute out_stream.



6
7
8
# File 'lib/wifi_wand/runtime_config.rb', line 6

def out_stream
  @out_stream
end

#utcObject

Returns the value of attribute utc.



5
6
7
# File 'lib/wifi_wand/runtime_config.rb', line 5

def utc
  @utc
end

#verboseObject

Returns the value of attribute verbose.



5
6
7
# File 'lib/wifi_wand/runtime_config.rb', line 5

def verbose
  @verbose
end

Instance Method Details

#to_hObject



23
24
25
26
27
28
29
30
# File 'lib/wifi_wand/runtime_config.rb', line 23

def to_h
  {
    verbose:    verbose,
    utc:        utc,
    out_stream: out_stream,
    err_stream: err_stream,
  }
end