Method: Moped::Protocol::Message::ClassMethods#cstring
- Defined in:
- lib/moped/protocol/message.rb
#cstring(name) ⇒ Object
Declare a null terminated string field.
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/moped/protocol/message.rb', line 116 def cstring(name) attr_accessor name class_eval <<-RUBY, __FILE__, __LINE__ + 1 def serialize_#{name}(buffer) buffer << #{name} buffer << 0 end RUBY fields << name end |