Class: SmartCore::Operation::Result::Success

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

Overview

Since:

  • 0.1.0

Instance Method Summary collapse

Methods inherited from Basic

#callback?, #failure?, #fatal?

Constructor Details

#initialize(**result_options) ⇒ void

Parameters:

  • result_options (Hash<Symbol,Any>)

Since:

  • 0.1.0



11
12
13
14
15
# File 'lib/smart_core/operation/result/success.rb', line 11

def initialize(**result_options)
  __prevent_core_methods_overlapping__(result_options)
  super(result_options)
  __define_virtual_acessors__(result_options)
end

Instance Method Details

#success? {|SmartCore::Operation::Result::Success| ... } ⇒ Boolean

Yields:

Returns:

  • (Boolean)

Since:

  • 0.1.0



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

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

#to_hHash<Symbol,Any> Also known as: to_hash

Returns:

  • (Hash<Symbol,Any>)

Since:

  • 0.1.0



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

def to_h
  __result_options__.dup
end