Class: Statefully::State::Failure

Inherits:
Statefully::State show all
Defined in:
lib/statefully/state.rb

Overview

Failure is a failed State.

Instance Attribute Summary collapse

Attributes inherited from Statefully::State

#previous

Instance Method Summary collapse

Methods inherited from Statefully::State

create, #history

Constructor Details

#initialize(values, error, previous:) ⇒ Failure



107
108
109
110
# File 'lib/statefully/state.rb', line 107

def initialize(values, error, previous:)
  super(values, previous: previous)
  @error = error
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Statefully::State

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



105
106
107
# File 'lib/statefully/state.rb', line 105

def error
  @error
end

Instance Method Details

#diffObject



112
113
114
# File 'lib/statefully/state.rb', line 112

def diff
  error
end

#inspectObject



124
125
126
# File 'lib/statefully/state.rb', line 124

def inspect
  inspect_details(error: error.inspect)
end

#resolveObject



120
121
122
# File 'lib/statefully/state.rb', line 120

def resolve
  raise error
end

#success?Boolean



116
117
118
# File 'lib/statefully/state.rb', line 116

def success?
  false
end