Exception: Servactory::Exceptions::Failure
- Defined in:
- lib/servactory/exceptions/failure.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type: :base, message:, meta: nil) ⇒ Failure
constructor
rubocop:disable Style/KeywordParametersOrder.
-
#method_missing(name, *_args) ⇒ Object
rubocop:disable Naming/PredicateMethod.
- #respond_to_missing?(name) ⇒ Boolean
Constructor Details
#initialize(type: :base, message:, meta: nil) ⇒ Failure
rubocop:disable Style/KeywordParametersOrder
10 11 12 13 14 15 16 |
# File 'lib/servactory/exceptions/failure.rb', line 10 def initialize(type: :base, message:, meta: nil) # rubocop:disable Style/KeywordParametersOrder @type = type @message = @meta = super() end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *_args) ⇒ Object
rubocop:disable Naming/PredicateMethod
18 19 20 |
# File 'lib/servactory/exceptions/failure.rb', line 18 def method_missing(name, *_args) # rubocop:disable Naming/PredicateMethod @type == normalize_method_name(name) end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'lib/servactory/exceptions/failure.rb', line 6 def @message end |
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
6 7 8 |
# File 'lib/servactory/exceptions/failure.rb', line 6 def @meta end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/servactory/exceptions/failure.rb', line 6 def type @type end |
Instance Method Details
#respond_to_missing?(name) ⇒ Boolean
22 23 24 |
# File 'lib/servactory/exceptions/failure.rb', line 22 def respond_to_missing?(name, *) @type == normalize_method_name(name) || super end |