Class: Spectus::RequirementLevel::Base Private

Inherits:
Object
  • Object
show all
Defined in:
lib/spectus/requirement_level/base.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.

Requirement level’s base class.

Direct Known Subclasses

High, Low, Medium

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(matcher, negate, subject, *challenges) ⇒ Base

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.

Initialize the requirement level class.

Parameters:

  • matcher (#matches?)

    The matcher.

  • negate (Boolean)

    Evaluate to a negative assertion.

  • subject (#object_id)

    The front object to test.

  • challenges (Array)

    A list of challenges.



20
21
22
23
24
25
# File 'lib/spectus/requirement_level/base.rb', line 20

def initialize(matcher, negate, subject, *challenges)
  @matcher    = matcher
  @negate     = negate
  @subject    = subject
  @challenges = challenges
end

Instance Attribute Details

#challengesArray (readonly)

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.

Returns A list of challenges.

Returns:

  • (Array)

    A list of challenges.



47
48
49
# File 'lib/spectus/requirement_level/base.rb', line 47

def challenges
  @challenges
end

#matcher#matches? (readonly)

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.

Returns The matcher.

Returns:

  • (#matches?)

    The matcher.



30
31
32
# File 'lib/spectus/requirement_level/base.rb', line 30

def matcher
  @matcher
end

#subject#object_id (readonly)

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.

Returns The front object to test.

Returns:

  • (#object_id)

    The front object to test.



42
43
44
# File 'lib/spectus/requirement_level/base.rb', line 42

def subject
  @subject
end

Instance Method Details

#negate?Boolean

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.

The value of the negate instance variable.

Returns:

  • (Boolean)

    Evaluated to a negative assertion or not.



35
36
37
# File 'lib/spectus/requirement_level/base.rb', line 35

def negate?
  @negate
end