Class: EPlat::Initializer

Inherits:
Object
  • Object
show all
Defined in:
lib/e_plat/initializer.rb

Constant Summary collapse

REQUIRED_CLASSES =
EPlat::SUPPORTED_RESOURCES.map do |resource|
  [
    "EPlat::#{ resource.classify }",
    EPlat::SUPPORTED_PLATFORMS.map do |platform|
      "EPlat::#{ platform.classify }::#{ resource.classify }"
    end
  ]
end.flatten.freeze

Class Method Summary collapse

Class Method Details

.check_required_classes!Object



14
15
16
17
18
19
20
# File 'lib/e_plat/initializer.rb', line 14

def check_required_classes!
  REQUIRED_CLASSES.each do |klass|
    unless Object.const_defined?(klass)
      raise EPlat::Error, "Required class #{klass} not defined"
    end
  end
end