Class: Package::Audit::Technology::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/package/audit/technology/validator.rb

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ Validator

Returns a new instance of Validator.



8
9
10
# File 'lib/package/audit/technology/validator.rb', line 8

def initialize(dir)
  @dir = dir
end

Instance Method Details

#validate!(technology) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/package/audit/technology/validator.rb', line 12

def validate!(technology)
  case technology
  when Enum::Technology::NODE
    validate_node!
  when Enum::Technology::RUBY
    validate_ruby!
  else
    raise ArgumentError, "\"#{technology}\" is not a supported technology, " \
                         "use one of #{Enum::Technology.all}"
  end
end