Class: Pippi::CheckLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/pippi/check_loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ctx, check_names) ⇒ CheckLoader

Returns a new instance of CheckLoader.



5
6
7
8
9
10
11
12
# File 'lib/pippi/check_loader.rb', line 5

def initialize(ctx, check_names)
  @ctx = ctx
  @check_names = if check_names.is_a?(String)
                   Pippi::CheckSetMapper.new(check_names).check_names
  else
    check_names
  end
end

Instance Attribute Details

#check_namesObject (readonly)

Returns the value of attribute check_names.



3
4
5
# File 'lib/pippi/check_loader.rb', line 3

def check_names
  @check_names
end

#ctxObject (readonly)

Returns the value of attribute ctx.



3
4
5
# File 'lib/pippi/check_loader.rb', line 3

def ctx
  @ctx
end

Instance Method Details

#checksObject



14
15
16
17
18
# File 'lib/pippi/check_loader.rb', line 14

def checks
  check_names.map do |check_name|
    Pippi::Checks.const_get(check_name).new(ctx)
  end
end