Exception: PyCall::PyError
- Defined in:
- lib/pycall/pyerror.rb
Instance Attribute Summary collapse
-
#traceback ⇒ Object
readonly
Returns the value of attribute traceback.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type, value, traceback) ⇒ PyError
constructor
A new instance of PyError.
- #to_s ⇒ Object
Constructor Details
#initialize(type, value, traceback) ⇒ PyError
Returns a new instance of PyError.
5 6 7 8 9 10 |
# File 'lib/pycall/pyerror.rb', line 5 def initialize(type, value, traceback) @type = type @value = value @traceback = traceback super("Exception occurred in Python") end |
Instance Attribute Details
#traceback ⇒ Object (readonly)
Returns the value of attribute traceback.
12 13 14 |
# File 'lib/pycall/pyerror.rb', line 12 def traceback @traceback end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
12 13 14 |
# File 'lib/pycall/pyerror.rb', line 12 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
12 13 14 |
# File 'lib/pycall/pyerror.rb', line 12 def value @value end |
Instance Method Details
#to_s ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/pycall/pyerror.rb', line 14 def to_s "#{type}: #{value}".tap do |msg| if (strs = format_traceback) msg << "\n" strs.each {|s| msg << s } end end end |