Exception: BdecodeError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pos = nil) ⇒ BdecodeError

:nodoc:



139
140
141
# File 'lib/bencode.rb', line 139

def initialize(pos = nil) # :nodoc:
  @pos = pos
end

Instance Attribute Details

#posObject (readonly)

Returns the value of attribute pos.



137
138
139
# File 'lib/bencode.rb', line 137

def pos
  @pos
end

Instance Method Details

#to_sObject

:nodoc:



143
144
145
146
147
148
149
# File 'lib/bencode.rb', line 143

def to_s # :nodoc:
  if pos.nil?
    "syntax error"
  else
    "syntax error near position #{pos}"
  end
end