Class: FPM::Scriptable::Config::GeneralConfig

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

Instance Method Summary collapse

Constructor Details

#initializeGeneralConfig

Returns a new instance of GeneralConfig.



33
34
35
# File 'lib/fpm/scriptable/config.rb', line 33

def initialize
  @u_defined      = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missingObject



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/fpm/scriptable/config.rb', line 50

def udefine(name, *opts)
  if !name.nil?
    name = name.to_s
    if name =~ /\=\z/
      name.gsub! /\=/, ''
      if opts.size == 1
        @u_defined[name.to_sym] = opts.first
      end
    else
      @u_defined[name.to_sym]
    end
  end
end

Instance Method Details

#udefine(name, *opts) ⇒ Object Also known as: method_missing



37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/fpm/scriptable/config.rb', line 37

def udefine(name, *opts)
  if !name.nil?
    name = name.to_s
    if name =~ /\=\z/
      name.gsub! /\=/, ''
      if opts.size == 1
        @u_defined[name.to_sym] = opts.first
      end
    else
      @u_defined[name.to_sym]
    end
  end
end