Class: Beefcake::Buffer

Inherits:
Object
  • Object
show all
Defined in:
lib/warden/protocol/base.rb

Instance Method Summary collapse

Instance Method Details

#append_string(s) ⇒ Object

Patch beefcake to be encoding-agnostic



8
9
10
11
12
13
14
15
# File 'lib/warden/protocol/base.rb', line 8

def append_string(s)
  if s.respond_to?(:force_encoding)
    s = s.dup.force_encoding("binary")
  end

  append_uint64(s.length)
  self << s
end