Class: Jimmy::Loaders::Base Abstract
- Inherits:
-
Object
- Object
- Jimmy::Loaders::Base
- Defined in:
- lib/jimmy/loaders/base.rb
Overview
This class is abstract.
Base class for all file loaders
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
The source file to be loaded.
Class Method Summary collapse
-
.call(file) ⇒ Object
private
Load the given file.
Instance Method Summary collapse
-
#initialize(source) ⇒ Base
constructor
A new instance of Base.
- #load ⇒ Jimmy::Schema
Constructor Details
#initialize(source) ⇒ Base
Returns a new instance of Base.
20 21 22 |
# File 'lib/jimmy/loaders/base.rb', line 20 def initialize(source) @source = Pathname(source) end |
Instance Attribute Details
#source ⇒ Object (readonly)
The source file to be loaded.
17 18 19 |
# File 'lib/jimmy/loaders/base.rb', line 17 def source @source end |
Class Method Details
.call(file) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Load the given file. Intended to be used by a FileMap.
11 12 13 |
# File 'lib/jimmy/loaders/base.rb', line 11 def self.call(file) new(file).load end |
Instance Method Details
#load ⇒ Jimmy::Schema
25 26 27 |
# File 'lib/jimmy/loaders/base.rb', line 25 def load raise NotImplementedError, "Please implement #load on #{self.class}" end |