Class: IO

Inherits:
Object show all
Includes:
BEncode::ParseIO
Defined in:
lib/bencode/core_ext/io.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BEncode::ParseIO

#peek

Class Method Details

.bdecode(filename) ⇒ Object



6
7
8
# File 'lib/bencode/core_ext/io.rb', line 6

def self.bdecode(filename)
  open(filename, 'rb') {|io| io.bdecode}
end

.bencode(filename) ⇒ Object



10
11
12
# File 'lib/bencode/core_ext/io.rb', line 10

def self.bencode(filename)
  open(filename, 'rb') {|io| io.bencode}
end

Instance Method Details

#bdecodeObject



14
15
16
# File 'lib/bencode/core_ext/io.rb', line 14

def bdecode
  read.chomp.bdecode
end

#bencodeObject



18
19
20
# File 'lib/bencode/core_ext/io.rb', line 18

def bencode
  read.chomp.bencode
end