Class: AmazingActivist::Success

Inherits:
Literal::Data
  • Object
show all
Includes:
Outcome
Defined in:
lib/amazing_activist/success.rb

Constant Summary

Constants included from Outcome

Outcome::Failure, Outcome::Success

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Outcome

#inspect, #unwrap!, #value_or

Instance Attribute Details

#activityAmazingActivist::Base (readonly)



13
# File 'lib/amazing_activist/success.rb', line 13

prop :activity, AmazingActivist::Base

#successAmazingActivist::Base (readonly)



9
# File 'lib/amazing_activist/success.rb', line 9

prop :value, _Any?, :positional

Instance Method Details

#deconstructArray

Returns:

  • (Array)


20
21
22
# File 'lib/amazing_activist/success.rb', line 20

def deconstruct
  [:success, value, activity]
end

#deconstruct_keys(_) ⇒ Hash

Returns:

  • (Hash)


26
27
28
# File 'lib/amazing_activist/success.rb', line 26

def deconstruct_keys(_)
  { success: value, activity: }
end

#failure?Boolean

Returns:

  • (Boolean)


15
# File 'lib/amazing_activist/success.rb', line 15

def failure? = false

#success?Boolean

Returns:

  • (Boolean)


16
# File 'lib/amazing_activist/success.rb', line 16

def success? = true