Class: Jimmy::Loaders::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/jimmy/loaders/base.rb

Overview

This class is abstract.

Base class for all file loaders

Direct Known Subclasses

JSON, Ruby

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ Base



20
21
22
# File 'lib/jimmy/loaders/base.rb', line 20

def initialize(source)
  @source = Pathname(source)
end

Instance Attribute Details

#sourceObject (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

#loadJimmy::Schema

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/jimmy/loaders/base.rb', line 25

def load
  raise NotImplementedError, "Please implement #load on #{self.class}"
end