Class: WebpackerLite::FileLoader
- Inherits:
-
Object
- Object
- WebpackerLite::FileLoader
- Defined in:
- lib/webpacker_lite/file_loader.rb
Overview
Provides a base singleton-configuration pattern for loading a JSON or YAML file, given a path
Direct Known Subclasses
Defined Under Namespace
Classes: FileLoaderError, NotFoundError
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Class Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
7 8 9 |
# File 'lib/webpacker_lite/file_loader.rb', line 7 def data @data end |
Class Method Details
.file_path ⇒ Object
14 15 16 |
# File 'lib/webpacker_lite/file_loader.rb', line 14 def file_path raise FileLoaderError.new("Subclass of WebpackerLite::FileLoader should override this method") end |
.load_instance(path = file_path) ⇒ Object
10 11 12 |
# File 'lib/webpacker_lite/file_loader.rb', line 10 def load_instance(path = file_path) self.instance = new(path) end |