Class: Dockdev::UserConfig

Inherits:
Object
  • Object
show all
Includes:
TR::CondUtils
Defined in:
lib/dockdev/user_config.rb

Instance Method Summary collapse

Constructor Details

#initialize(conf) ⇒ UserConfig

Returns a new instance of UserConfig.



7
8
9
# File 'lib/dockdev/user_config.rb', line 7

def initialize(conf)
  @res = parse(conf)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(mtd, *args, &block) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/dockdev/user_config.rb', line 15

def method_missing(mtd, *args, &block)
  if has_key?(mtd)
    @res[mtd.to_sym]
  else
    nil
    #super
  end
end

Instance Method Details

#has_key?(key) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/dockdev/user_config.rb', line 24

def has_key?(key)
  @res.keys.include?(key.to_sym)
end

#is_valid?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/dockdev/user_config.rb', line 11

def is_valid?
  @valid 
end