Module MethodSignatureMixin
In: lib/contract/integration.rb
Method Contract Module UnboundMethod Contract::Check::Any Contract::Check::All Contract::Check::None Contract::Check::Block Contract::Check::Base Contract::Check::Quack MethodSignatureMixin Kernel lib/contract/integration.rb

Modifies Method and UnboundMethod so that signatures set by Module.signatures can be retrieved.

Note that this can only work when the method origin and definition name are known which is the reason for ruby-contract currently overloading all methods that return a method.

This could be greatly simplified it www.rcrchive.net/rcr/show/292 were to be accepted. You can help the development of ruby-contract by voting for that RCR.

Methods

Public Instance methods

Returns whether a signatue for this method was defined via Module#signature.

[Source]

     # File lib/contract/integration.rb, line 608
608:   def has_signature?() @has_signature end

Returns the signature of this method in the form of [fixed types, options]. If no signature was specified via Module#signature it will still return something useful.

This information can be useful in meta programming.

[Source]

     # File lib/contract/integration.rb, line 604
604:   def signature() @signature end

[Validate]