Class: Rack::Auth::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/auth/gitlabapi.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = { file: './gitlab.yml'}) ⇒ Config

Returns a new instance of Config.



11
12
13
14
15
16
17
18
19
20
# File 'lib/rack/auth/gitlabapi.rb', line 11

def initialize(options = { file: './gitlab.yml'})
  @values = ::YAML.load_file(::File.expand_path(options[:file], Dir.pwd))
  @values.keys.each do |key|
    @values[key.to_sym] = @values.delete(key)
  end
  @values.keys.each do |meth|
    bloc = Proc.new  {@values[meth] }
      self.class.send :define_method, meth, &bloc
  end
end