class Compact::ArgumentInterceptor
Attributes
invocations[RW]
Public Class Methods
new(delegate)
click to toggle source
Calls superclass method
# File lib/compact/argument_interceptor.rb, line 5 def initialize(delegate) @invocations = [] @contract = nil super end
Public Instance Methods
method_missing(method, *args, &block)
click to toggle source
Calls superclass method
# File lib/compact/argument_interceptor.rb, line 15 def method_missing(method, *args, &block) returns = super invocation = Invocation.new(method: method, args: args, returns: returns) @invocations.push(invocation) @contract.add_invocation(invocation) if @contract returns end
register(contract)
click to toggle source
# File lib/compact/argument_interceptor.rb, line 11 def register(contract) @contract = contract end