Class: Statefully::Diff::Failed

Inherits:
Statefully::Diff show all
Defined in:
lib/statefully/diff.rb

Overview

Failed represents a difference between a succesful and failed State.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Statefully::Diff

#added, #added?, #changed, #changed?, create, #empty?

Constructor Details

#initialize(error) ⇒ Failed

Constructor for Statefully::Diff::Failed

Examples:

Statefully::Diff::Failed.new(RuntimeError.new('Boom!'))
=> #<Statefully::Diff::Failed error=#<RuntimeError: Boom!>>

Parameters:

  • error (StandardError)

    error that caused the State to fail


251
252
253
# File 'lib/statefully/diff.rb', line 251

def initialize(error)
  @error = error
end

Instance Attribute Details

#errorStandardError (readonly)

Error that caused the State to fail

Examples:

Statefully::Diff::Failed.new(RuntimeError.new('Boom!')).error
=> #<RuntimeError: Boom!>

Returns:

  • (StandardError)

242
243
244
# File 'lib/statefully/diff.rb', line 242

def error
  @error
end

Instance Method Details

#inspectString

Human-readable representation of the Statefully::Diff::Failed

Examples:

Statefully::Diff::Failed.new(RuntimeError.new('Boom!'))
=> #<Statefully::Diff::Failed error=#<RuntimeError: Boom!>>

Returns:

  • (String)

262
263
264
# File 'lib/statefully/diff.rb', line 262

def inspect
  "#<#{self.class.name} error=#{error.inspect}>"
end