Class: PasswordExpirationNotifier::Config

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

Instance Method Summary collapse

Constructor Details

#initialize(options = nil) ⇒ Config

Returns a new instance of Config.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/password_expiration_notifier/config.rb', line 7

def initialize(options = nil)
  @table = {}
  @hash_table = {}

  if options
    if options[:config]
      conf = YAML.load_file(options[:config])
      @table, @hash_table = load_config(conf)
    end

    @table, @hash_table = load_config(options, @table, @hash_table)
  end
end

Instance Method Details

#to_hObject



21
22
23
# File 'lib/password_expiration_notifier/config.rb', line 21

def to_h
  @hash_table
end