Class: Array

Inherits:
Object show all
Defined in:
lib/bencode.rb

Instance Method Summary collapse

Instance Method Details

#bencodeObject

Bencodes the Array object. Bencoded arrays are represented as lxe, where x is zero or more bencoded objects.

[1, "foo"].bencode   #=> "li1e3:fooe"


90
91
92
# File 'lib/bencode.rb', line 90

def bencode
  "l#{map{|obj| obj.bencode}.join('') }e"
end