Exception: Ncn::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Ncn::Error
- Defined in:
- lib/ncn/error.rb
Constant Summary collapse
- RepoIsEmpty =
Class.new(self)
- NoteNotFound =
Class.new(self)
- NonValidNoteId =
Class.new(self)
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(context = {}) ⇒ Error
constructor
A new instance of Error.
- #message ⇒ Object
- #to_json ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(context = {}) ⇒ Error
Returns a new instance of Error.
9 10 11 |
# File 'lib/ncn/error.rb', line 9 def initialize(context = {}) @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
7 8 9 |
# File 'lib/ncn/error.rb', line 7 def context @context end |
Instance Method Details
#message ⇒ Object
13 14 15 |
# File 'lib/ncn/error.rb', line 13 def context[:message] || end |
#to_json ⇒ Object
21 22 23 |
# File 'lib/ncn/error.rb', line 21 def to_json JSON.generate(context) end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/ncn/error.rb', line 17 def to_s end |