Class: SmartCore::Operation::Result::Error::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_core/operation/result/error/context.rb

Overview

Since:

  • 0.1.0

Constant Summary collapse

EMPTY_CONTEXT =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Returns:

  • (Hash)

Since:

  • 0.1.0

{}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context = EMPTY_CONTEXT.dup) ⇒ 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.

Parameters:

  • context (Hash, Any) (defaults to: EMPTY_CONTEXT.dup)

Since:

  • 0.1.0



23
24
25
# File 'lib/smart_core/operation/result/error/context.rb', line 23

def initialize(context = EMPTY_CONTEXT.dup)
  @context = context
end

Instance Attribute Details

#contextHash, Any (readonly)

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.

Returns:

  • (Hash, Any)

Since:

  • 0.1.0



16
17
18
# File 'lib/smart_core/operation/result/error/context.rb', line 16

def context
  @context
end

Instance Method Details

#to_hObject Also known as: data

Since:

  • 0.1.0



31
32
33
# File 'lib/smart_core/operation/result/error/context.rb', line 31

def to_h
  context.to_h
end