Module: Ruboty::Env::Validatable

Extended by:
ActiveSupport::Concern
Included in:
Adapters::Base, Brains::Base, Handlers::Base
Defined in:
lib/ruboty/env/validatable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#validateObject


20
21
22
23
24
# File 'lib/ruboty/env/validatable.rb', line 20

def validate
  self.class.envs.each(&:validate)
rescue MissingRequiredKeyError => exception
  raise ValidationError, "#{exception}\n#{self.class.usage}"
end

#validate!Object


26
27
28
29
30
# File 'lib/ruboty/env/validatable.rb', line 26

def validate!
  validate
rescue ValidationError => exception
  Ruboty.die(exception)
end