Exception: Sndfile::Error
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Sndfile::Error
- Defined in:
- lib/sndfile/error.rb
Overview
Exception raised in case of errors from libsndfile. The message contains the libsndfile error message.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#initialize(args) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ Error
Returns a new instance of Error.
10 11 12 13 14 15 |
# File 'lib/sndfile/error.rb', line 10 def initialize(args) args = args.keyword_args(:description, :code, :file) @description = args.description @code = args.code @file = args.file end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
8 9 10 |
# File 'lib/sndfile/error.rb', line 8 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/sndfile/error.rb', line 7 def description @description end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
9 10 11 |
# File 'lib/sndfile/error.rb', line 9 def file @file end |
Instance Method Details
#to_s ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/sndfile/error.rb', line 17 def to_s s = "" s << @description if @description s << " (#{@code})" if @code s << " [#{@file}]" if @file s end |