Class: Array
Instance Method Summary collapse
-
#bencode ⇒ Object
Bencodes the Array object.
Instance Method Details
#bencode ⇒ Object
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 |