Module: Ellen::Env::Validatable

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

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#validateObject



20
21
22
23
24
# File 'lib/ellen/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/ellen/env/validatable.rb', line 26

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