Class: Contracts::Returns
Overview
–
- Author
-
radiospiel ([email protected])
- Copyright
-
Copyright © 2011, 2012 radiospiel
- License
-
Distributes under the terms of the Modified BSD License, see LICENSE.BSD for details.
++
Instance Attribute Summary collapse
-
#expectation ⇒ Object
readonly
Returns the value of attribute expectation.
Attributes inherited from Base
Instance Method Summary collapse
- #after_call(_, rv, _receiver, *_args, &_blk) ⇒ Object
-
#initialize(expectation) ⇒ Returns
constructor
A new instance of Returns.
Methods inherited from Base
Constructor Details
#initialize(expectation) ⇒ Returns
Returns a new instance of Returns.
11 12 13 |
# File 'lib/contracts/returns.rb', line 11 def initialize(expectation) @expectation = expectation end |
Instance Attribute Details
#expectation ⇒ Object (readonly)
Returns the value of attribute expectation.
9 10 11 |
# File 'lib/contracts/returns.rb', line 9 def expectation @expectation end |
Instance Method Details
#after_call(_, rv, _receiver, *_args, &_blk) ⇒ Object
15 16 17 18 19 |
# File 'lib/contracts/returns.rb', line 15 def after_call(_, rv, _receiver, *_args, &_blk) Expectation::Matcher.match! rv, expectation rescue Expectation::Error error! "#{$ERROR_INFO} in return of `#{method_name}`" end |