Module: Spectus::Result::Base Private
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Result base’s module.
Instance Attribute Summary collapse
-
#actual ⇒ #object_id
readonly
private
The value that the subject return through its challenge.
-
#challenge ⇒ Symbol
readonly
private
The method to call on the subject.
-
#context ⇒ Array
readonly
private
Parameters of the challenge.
-
#error ⇒ #exception?
readonly
private
Any possible raised exception.
-
#expected ⇒ Array, ...
readonly
private
The definition of the expected value.
-
#got ⇒ #object_id
readonly
private
The result of the boolean comparison between the actual value and the expected value.
-
#level ⇒ :High, ...
readonly
private
The level of the expectation.
-
#subject ⇒ #object_id
readonly
private
The untrusted object to be tested.
Instance Method Summary collapse
-
#initialize(message, subject, challenge, context, actual, expected, got, error, level, negate, valid) ⇒ Object
private
Initialize the result class.
-
#negate? ⇒ Boolean
private
The value of the negate instance variable.
-
#to_h ⇒ Hash
private
Properties of the result.
-
#valid? ⇒ Boolean
private
The value of the boolean comparison between the actual value and the expected value.
Instance Attribute Details
#actual ⇒ #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 value that the subject return through its challenge.
61 62 63 |
# File 'lib/spectus/result/base.rb', line 61 def actual @actual end |
#challenge ⇒ Symbol (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 method to call on the subject.
50 51 52 |
# File 'lib/spectus/result/base.rb', line 50 def challenge @challenge end |
#context ⇒ Array (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 Parameters of the challenge.
55 56 57 |
# File 'lib/spectus/result/base.rb', line 55 def context @context end |
#error ⇒ #exception? (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 Any possible raised exception.
77 78 79 |
# File 'lib/spectus/result/base.rb', line 77 def error @error end |
#expected ⇒ Array, ... (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 definition of the expected value.
66 67 68 |
# File 'lib/spectus/result/base.rb', line 66 def expected @expected end |
#got ⇒ #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 result of the boolean comparison between the actual value and the expected value.
72 73 74 |
# File 'lib/spectus/result/base.rb', line 72 def got @got end |
#level ⇒ :High, ... (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 level of the expectation.
82 83 84 |
# File 'lib/spectus/result/base.rb', line 82 def level @level 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 untrusted object to be tested.
45 46 47 |
# File 'lib/spectus/result/base.rb', line 45 def subject @subject end |
Instance Method Details
#initialize(message, subject, challenge, context, actual, expected, got, error, level, negate, valid) ⇒ Object
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 result class.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/spectus/result/base.rb', line 26 def initialize(, subject, challenge, context, actual, expected, got, error, level, negate, valid) = @subject = subject @challenge = challenge @context = context @actual = actual @expected = expected @got = got @error = error @level = level @negate = negate @valid = valid end |
#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.
87 88 89 |
# File 'lib/spectus/result/base.rb', line 87 def negate? @negate end |
#to_h ⇒ Hash
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.
Properties of the result.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/spectus/result/base.rb', line 102 def to_h { subject: subject, challenge: challenge, context: context, actual: actual, expected: expected, got: got, error: error, level: level, negate: negate?, valid: valid?, result: result? } end |
#valid? ⇒ 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 boolean comparison between the actual value and the expected value.
95 96 97 |
# File 'lib/spectus/result/base.rb', line 95 def valid? @valid end |