Sha256: 519e08cab9466190abb2119aa37b0fc941b5ad022f636c7fb61646cfe805a513

Contents?: true

Size: 447 Bytes

Versions: 2

Compression:

Stored size: 447 Bytes

Contents

require 'rubygems'
require 'erlectricity'

require 'bert/encoder'
require 'bert/decoder'

module BERT
  def self.encode(ruby)
    Encoder.encode(ruby)
  end

  def self.decode(bert)
    Decoder.decode(bert)
  end

  def self.ebin(str)
    bytes = []
    str.each_byte { |b| bytes << b.to_s }
    "<<" + bytes.join(',') + ">>"
  end
end

module BERT
  class Tuple < Array
    def inspect
      "t#{super}"
    end
  end
end

def t
  BERT::Tuple
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bert-1.0.0 lib/bert.rb
bert-0.2.0 lib/bert.rb