Method: Protocol::ProtocolModule#inspect
- Defined in:
- lib/protocol/protocol_module.rb
#inspect ⇒ Object
Returns a short string representation of this protocol, that consists of the understood messages. This protocol
FooProtocol = Protocol do
def (x, y, &b) end
def baz(x, y, z) end
def foo(*rest) end
end
returns this string:
#<FooProtocol: bar(2&), baz(3), foo(-1)>
128 129 130 |
# File 'lib/protocol/protocol_module.rb', line 128 def inspect "#<#{name}: #{messages.map { |m| m.shortcut } * ', '}>" end |