In Files

Parent

Files

Protocol::Postcondition

This class is a proxy that stores postcondition blocks, which are called after the result of the wrapped method was determined.

Public Class Methods

new(object) click to toggle source

(Not documented)

# File lib/protocol.rb, line 154
    def initialize(object)
      @object = object
      @blocks = []
    end

Public Instance Methods

__result__() click to toggle source

This is the alternative result “keyword”.

# File lib/protocol.rb, line 160
    def __result__
      @result
    end
method_missing(*a, &b) click to toggle source

Send all remaining messages to the object.

# File lib/protocol.rb, line 198
    def method_missing(*a, &b)
      @object.__send__(*a, &b)
    end
myself() click to toggle source

This is the “keyword” to be used instead of self to refer to current object.

# File lib/protocol.rb, line 178
    def myself
      @object
    end
result() click to toggle source

This is the result “keyword” which can be used to query the result of wrapped method in a postcondition clause.

# File lib/protocol.rb, line 166
    def result
      if @object.respond_to? :result
        warn "#{@object.class} already defines a result method, "\
          "try __result__ instead"
        @object.__send__(:result)
      else
        @result
      end
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.