Class: Serverkit::Loaders::BaseLoader
- Inherits:
-
Object
- Object
- Serverkit::Loaders::BaseLoader
- Defined in:
- lib/serverkit/loaders/base_loader.rb
Direct Known Subclasses
Constant Summary collapse
- YAML_EXTNAMES =
[".yaml", ".yml"]
Instance Method Summary collapse
-
#initialize(path) ⇒ BaseLoader
constructor
A new instance of BaseLoader.
- #load ⇒ Object
Constructor Details
#initialize(path) ⇒ BaseLoader
Returns a new instance of BaseLoader.
14 15 16 |
# File 'lib/serverkit/loaders/base_loader.rb', line 14 def initialize(path) @path = path end |
Instance Method Details
#load ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/serverkit/loaders/base_loader.rb', line 18 def load case when !pathname.exist? raise Errors::NonExistentPathError, pathname when has_directory_path? load_from_directory when has_erb_path? load_from_erb else load_from_data end end |