class Mocha::ReturnValues
Attributes
Public Class Methods
Source
# File lib/mocha/return_values.rb, line 5 def self.build(*values) new(*values.map { |value| SingleReturnValue.new(value) }) end
Source
# File lib/mocha/return_values.rb, line 11 def initialize(*values) @values = values end
Public Instance Methods
Source
# File lib/mocha/return_values.rb, line 23 def +(other) self.class.new(*(@values + other.values)) end
Source
# File lib/mocha/return_values.rb, line 15 def next(invocation) case @values.length when 0 then nil when 1 then @values.first.evaluate(invocation) else @values.shift.evaluate(invocation) end end