This class encapsulates the protocol description, to check the classes against, if the Class#conform_to method is called with the protocol constant as an argument.
Creates a new Protocol::Descriptor object.
# File lib/protocol.rb, line 426 def initialize(protocol) @protocol = protocol @messages = {} end
Addes a new Protocol::Message instance to this Protocol::Descriptor object.
# File lib/protocol.rb, line 433 def add_message(message) @messages.key?(message.name) and raise SpecificationError, "A message named #{message.name} was already defined in #@protocol" @messages[message.name] = message end
Returns a string representation of this Protocol::Descriptor object.
# File lib/protocol.rb, line 445 def inspect "#<#{self.class}(#@protocol)>" end
Return all the messages stored in this Descriptor instance.
# File lib/protocol.rb, line 440 def messages @messages.values end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.