Class: TestData::CustomLoaders::AbstractBase

Inherits:
Object
  • Object
show all
Defined in:
lib/test_data/custom_loaders/abstract_base.rb

Direct Known Subclasses

RailsFixtures

Instance Method Summary collapse

Instance Method Details

#load(**options) ⇒ Object

Raises:



20
21
22
# File 'lib/test_data/custom_loaders/abstract_base.rb', line 20

def load(**options)
  raise Error.new("#load must be defined by CustomLoader subclass")
end

#load_requested(**options) ⇒ Object



8
9
# File 'lib/test_data/custom_loaders/abstract_base.rb', line 8

def load_requested(**options)
end

#loaded?(**options) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
# File 'lib/test_data/custom_loaders/abstract_base.rb', line 11

def loaded?(**options)
  # Check to see if the requested data is already loaded (if possible and
  # detectable)
  #
  # Return true to prevent #load from being called, potentially avoiding an
  # expensive operation
  false
end

#nameObject

Raises:



4
5
6
# File 'lib/test_data/custom_loaders/abstract_base.rb', line 4

def name
  raise Error.new("#name must be defined by CustomLoader subclass")
end