Class: Fixturama::Changes::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/fixturama/changes/base.rb

Overview

This class is abstract.

Base class for changes downloaded from a fixture

Direct Known Subclasses

Chain, Const, Request, Seed

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#key The key identifier of the change(Thekeyidentifierofthechange) ⇒ String (readonly)

Returns:

  • (String)


10
# File 'lib/fixturama/changes/base.rb', line 10

alias key hash

Instance Method Details

#call(_example) ⇒ self

This method is abstract.

Call the corresponding change (either a stub or a seed)

Parameters:

  • _example (RSpec::Core::Example)

    The RSpec example

Returns:

  • (self)


24
25
26
# File 'lib/fixturama/changes/base.rb', line 24

def call(_example)
  self
end

#merge(other) ⇒ Fixturama::Changes::Base

Merge the other change into the current one

Parameters:

Returns:



15
16
17
18
# File 'lib/fixturama/changes/base.rb', line 15

def merge(other)
  # By default just take the other change if applicable
  other.class == self.class && other.key == key ? other : self
end