Class: SmartCore::Operation::Result::Error::Case
- Inherits:
-
Object
- Object
- SmartCore::Operation::Result::Error::Case
- Defined in:
- lib/smart_core/operation/result/error/case.rb
Overview
Instance Method Summary collapse
- #code ⇒ String, ...
- #context ⇒ Hash
- #initialize(code: SmartCore::Operation::Result::Error::Code::EMPTY_CODE, context: SmartCore::Operation::Result::Error::Context::EMPTY_CONTEXT) ⇒ void constructor private
- #to_h ⇒ Hash<Synbol,Any>
Constructor Details
#initialize(code: SmartCore::Operation::Result::Error::Code::EMPTY_CODE, context: SmartCore::Operation::Result::Error::Context::EMPTY_CONTEXT) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 15 16 17 18 |
# File 'lib/smart_core/operation/result/error/case.rb', line 12 def initialize( code: SmartCore::Operation::Result::Error::Code::EMPTY_CODE, context: SmartCore::Operation::Result::Error::Context::EMPTY_CONTEXT ) @code = SmartCore::Operation::Result::Error::Code.new(code) @context = SmartCore::Operation::Result::Error::Context.new(context) end |
Instance Method Details
#code ⇒ String, ...
24 25 26 |
# File 'lib/smart_core/operation/result/error/case.rb', line 24 def code @code.identifier end |
#context ⇒ Hash
32 33 34 |
# File 'lib/smart_core/operation/result/error/case.rb', line 32 def context @context.data end |
#to_h ⇒ Hash<Synbol,Any>
40 41 42 |
# File 'lib/smart_core/operation/result/error/case.rb', line 40 def to_h { code: code, context: context } end |