Class: Mocha::ReturnValues
Overview
:nodoc:
Instance Attribute Summary collapse
-
#values ⇒ Object
Returns the value of attribute values.
Class Method Summary collapse
Instance Method Summary collapse
- #+(other) ⇒ Object
-
#initialize(*values) ⇒ ReturnValues
constructor
A new instance of ReturnValues.
- #next ⇒ Object
Constructor Details
#initialize(*values) ⇒ ReturnValues
Returns a new instance of ReturnValues.
13 14 15 |
# File 'lib/mocha/return_values.rb', line 13 def initialize(*values) @values = values end |
Instance Attribute Details
#values ⇒ Object
Returns the value of attribute values.
11 12 13 |
# File 'lib/mocha/return_values.rb', line 11 def values @values end |
Class Method Details
.build(*values) ⇒ Object
7 8 9 |
# File 'lib/mocha/return_values.rb', line 7 def self.build(*values) new(*values.map { |value| SingleReturnValue.new(value) }) end |
Instance Method Details
#+(other) ⇒ Object
25 26 27 |
# File 'lib/mocha/return_values.rb', line 25 def +(other) self.class.new(*(@values + other.values)) end |
#next ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/mocha/return_values.rb', line 17 def next case @values.length when 0 then nil when 1 then @values.first.evaluate else @values.shift.evaluate end end |