Class: SmartCore::Operation::Result::Error Private

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

Overview

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

Since:

  • 0.1.0

Direct Known Subclasses

Failure, Fatal

Defined Under Namespace

Classes: Case, Code, Context, Set

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Basic

#callback?, #failure?, #fatal?, #initialize, #success?

Constructor Details

This class inherits a constructor from SmartCore::Operation::Result::Basic

Instance Attribute Details

#errorsSmartCore::Operation::Result::Error::Set (readonly)



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

def errors
  @errors
end

Instance Method Details

#each_error(&block) ⇒ void

This method returns an undefined value.

Since:

  • 0.1.0



46
47
48
# File 'lib/smart_core/operation/result/error.rb', line 46

def each_error(&block)
  errors.each(&block)
end

#error? {|SmartCore::Operation::Result::Error| ... } ⇒ Boolean

Yields:

Returns:

  • (Boolean)

Since:

  • 0.1.0



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

def error?
  true.tap { yield(self) if block_given? }
end

#error_codesArray<String|Symbol|Any>

Returns:

  • (Array<String|Symbol|Any>)

Since:

  • 0.1.0



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

def error_codes
  errors.codes
end

#error_contextHash<String|Symbol,Any>

Returns:

  • (Hash<String|Symbol,Any>)

Since:

  • 0.1.0



38
39
40
# File 'lib/smart_core/operation/result/error.rb', line 38

def error_context
  errors.context
end