Class: Actionizer::Result

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/actionizer/result.rb

Instance Method Summary collapse

Constructor Details

#initialize(initial_hash = {}) ⇒ Result

Returns a new instance of Result.



6
7
8
9
# File 'lib/actionizer/result.rb', line 6

def initialize(initial_hash = {})
  @success = true
  super(initial_hash)
end

Instance Method Details

#failObject



19
20
21
# File 'lib/actionizer/result.rb', line 19

def fail
  @success = false
end

#failure?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/actionizer/result.rb', line 15

def failure?
  !@success
end

#success?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/actionizer/result.rb', line 11

def success?
  @success
end