class MethodCallCount::CallableStub
Public Class Methods
new(value = nil, &block)
click to toggle source
# File lib/method_call_count/callable_stub.rb, line 5 def initialize(value = nil, &block) @block = value.nil? ? block : ->(options){value} @called_with = {} end
Public Instance Methods
call(options={})
click to toggle source
# File lib/method_call_count/callable_stub.rb, line 9 def call(options={}) @called_with = options @block&.call(options) end
called_with()
click to toggle source
# File lib/method_call_count/callable_stub.rb, line 13 def called_with @called_with.dup end