Module: BELParser::Parsers::Buffer

Overview

Buffer module.

Instance Method Summary collapse

Instance Method Details

#ord_to_str(enumerable) ⇒ Object



9
10
11
# File 'lib/bel_parser/parsers/mixin/buffer.rb', line 9

def ord_to_str(enumerable)
	(enumerable.map { |x| x.chr }).join()
end

#utf8_string(buffer) ⇒ Object



5
6
7
# File 'lib/bel_parser/parsers/mixin/buffer.rb', line 5

def utf8_string(buffer)
  buffer.pack('C*').force_encoding('utf-8')
end