In Files

Parent

Files

Protocol::Descriptor

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.

Public Class Methods

new(protocol) click to toggle source

Creates a new Protocol::Descriptor object.

# File lib/protocol.rb, line 426
    def initialize(protocol)
      @protocol = protocol
      @messages = {}
    end

Public Instance Methods

add_message(message) click to toggle source

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
inspect() click to toggle source

Returns a string representation of this Protocol::Descriptor object.

# File lib/protocol.rb, line 445
    def inspect
      "#<#{self.class}(#@protocol)>"
    end
messages() click to toggle source

Return all the messages stored in this Descriptor instance.

# File lib/protocol.rb, line 440
    def messages
      @messages.values
    end
to_s() click to toggle source

(Not documented)

# File lib/protocol.rb, line 449
    def to_s
      messages * ', '
    end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.