Module: Webspicy::Specification::Condition
- Extended by:
- Forwardable
- Included in:
- Err, Errcondition, Oldies::Bridge, Post, Postcondition, Pre, Precondition
- Defined in:
- lib/webspicy/specification/condition.rb
Constant Summary collapse
- MATCH_ALL =
"__all__"
Instance Attribute Summary collapse
-
#matching_description ⇒ Object
Returns the value of attribute matching_description.
-
#tester ⇒ Object
readonly
Returns the value of attribute tester.
Class Method Summary collapse
-
.match(service, condition) ⇒ Object
Given a service and a condition, returns a Pre instance of there is a match, nil otherwise.
Instance Method Summary collapse
-
#bind(tester) ⇒ Object
Bind the condition instance to a current tester.
- #fail!(msg) ⇒ Object
- #sooner_or_later(*args, &bl) ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#matching_description ⇒ Object
Returns the value of attribute matching_description.
8 9 10 |
# File 'lib/webspicy/specification/condition.rb', line 8 def matching_description @matching_description end |
#tester ⇒ Object (readonly)
Returns the value of attribute tester.
20 21 22 |
# File 'lib/webspicy/specification/condition.rb', line 20 def tester @tester end |
Class Method Details
.match(service, condition) ⇒ Object
Given a service and a condition, returns a Pre instance of there is a match, nil otherwise.
12 13 |
# File 'lib/webspicy/specification/condition.rb', line 12 def self.match(service, condition) end |
Instance Method Details
#bind(tester) ⇒ Object
Bind the condition instance to a current tester.
16 17 18 19 |
# File 'lib/webspicy/specification/condition.rb', line 16 def bind(tester) @tester = tester self end |
#fail!(msg) ⇒ Object
34 35 36 |
# File 'lib/webspicy/specification/condition.rb', line 34 def fail!(msg) raise Tester::Failure, msg end |
#sooner_or_later(*args, &bl) ⇒ Object
30 31 32 |
# File 'lib/webspicy/specification/condition.rb', line 30 def sooner_or_later(*args, &bl) Webspicy::Support.sooner_or_later(*args, &bl) end |
#to_s ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/webspicy/specification/condition.rb', line 38 def to_s if matching_description == MATCH_ALL self.class.name else matching_description end end |