Class: Verifier::Verification Private

Inherits:
Object
  • Object
show all
Defined in:
lib/verifier/verification.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Verification runner

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, variable, name, &block) ⇒ undefined

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.

Initializes a verification object

Parameters:

  • object (Object)

    the object whose method should be verified

  • variable (Symbol)

    the name of the variable to be verified

  • name (Symbol)

    the name of verification

  • block (Proc)


21
22
23
24
# File 'lib/verifier/verification.rb', line 21

def initialize(object, variable, name, &block)
  fail SyntaxError.new "No block given" unless block_given?
  @object, @variable, @name, @block = object, variable, name, block
end

Class Method Details

.run(object, variable, name, &block) ⇒ undefined

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.

Constructs and runs a verification object

Parameters:

  • object (Object)

    the object whose method should be verified

  • variable (Symbol)

    the name of the variable to be verified

  • name (Symbol)

    the name of verification

  • block (Proc)

Returns:

  • (undefined)

Raises:



50
51
52
# File 'lib/verifier/verification.rb', line 50

def self.run(object, variable, name, &block)
  send(:new, object, variable, name, &block).run
end

Instance Method Details

#run { ... } ⇒ undefined

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.

Runs a verification

Yields:

  • block in the scope of a value returned by the #variable

Returns:

  • (undefined)

Raises:



38
39
40
41
# File 'lib/verifier/verification.rb', line 38

def run
  check_method_existence
  check_condition
end