lib/bencodr/parser.rb in bencodr-1.2.0 vs lib/bencodr/parser.rb in bencodr-2.0.0
- old
+ new
@@ -108,20 +108,6 @@
[key, value]
end
private :parse_key_value
end
end
-end
-
-class String
- # This method decodes a bencoded string into a ruby object.
- #
- # "6:string".bdecode #=> "string"
- # "i-1e".bdecode #=> -1
- # "le".bdecode #=> []
- # "de".bdecode #=> {}
- #
- # @return [::String, ::Integer, ::Array, ::Hash] the decoded object
- def bdecode
- BEncodr::Parser.parse_object(StringScanner.new self) or raise BEncodr::BEncodeError, "Invalid bencoding"
- end
end
\ No newline at end of file