Class: Dragnet::Verifiers::Verifier

Inherits:
Object
  • Object
show all
Includes:
Helpers::RepositoryHelper
Defined in:
lib/dragnet/verifiers/verifier.rb

Overview

Base class for all validators.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::RepositoryHelper

#relative_to_repo, #repo_base, #shorten_sha1

Constructor Details

#initialize(test_record:) ⇒ Verifier

Creates a new instance of the class.

Parameters:



16
17
18
# File 'lib/dragnet/verifiers/verifier.rb', line 16

def initialize(test_record:)
  @test_record = test_record
end

Instance Attribute Details

#test_recordObject (readonly)

Returns the value of attribute test_record.



11
12
13
# File 'lib/dragnet/verifiers/verifier.rb', line 11

def test_record
  @test_record
end

Instance Method Details

#verifyDragnet::VerificationResult?

Needs to be implemented by the child classes. This method is called to perform the verification on the given test_record.

Returns:

  • (Dragnet::VerificationResult, nil)

    The method should return a VerificationResult object if the verification fails or nil if it passes.

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/dragnet/verifiers/verifier.rb', line 25

def verify
  raise NotImplementedError, "Please implement #{__method__} in #{self.class}"
end