Class: Lookout::Stub::Method::Values

Inherits:
Object
  • Object
show all
Defined in:
lib/lookout/stub/method.rb

Instance Method Summary collapse

Constructor Details

#initialize(*values) ⇒ Values

Returns a new instance of Values.



5
6
7
8
# File 'lib/lookout/stub/method.rb', line 5

def initialize(*values)
  @values = values
  @offset = -1
end

Instance Method Details

#call {|self.next| ... } ⇒ Object

Yields:



15
16
17
# File 'lib/lookout/stub/method.rb', line 15

def call
  yield(*self.next)
end

#nextObject



10
11
12
13
# File 'lib/lookout/stub/method.rb', line 10

def next
  @offset = [@offset + 1, @values.count - 1].min
  @values[@offset]
end