Class: PullRequestAi::Error
- Inherits:
-
Object
- Object
- PullRequestAi::Error
- Defined in:
- lib/pull_request_ai/util/error.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Class Method Summary collapse
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(symbol, message = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(symbol, message = nil) ⇒ Error
Returns a new instance of Error.
7 8 9 10 |
# File 'lib/pull_request_ai/util/error.rb', line 7 def initialize(symbol, = nil) @symbol = symbol @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/pull_request_ai/util/error.rb', line 5 def @message end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
5 6 7 |
# File 'lib/pull_request_ai/util/error.rb', line 5 def symbol @symbol end |
Class Method Details
.failure(symbol, message = nil) ⇒ Object
22 23 24 25 |
# File 'lib/pull_request_ai/util/error.rb', line 22 def failure(symbol, = nil) new_instance = new(symbol, ) Dry::Monads::Failure(new_instance) end |
Instance Method Details
#description ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/pull_request_ai/util/error.rb', line 12 def description error_desc = SYMBOL_DETAILS[symbol] if error_desc error_desc + ( ? " #{}" : '') else || symbol.to_s end end |