Module: ActForm::Runnable

Extended by:
ActiveSupport::Concern
Included in:
Command
Defined in:
lib/act_form/runnable.rb

Instance Method Summary collapse

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/act_form/runnable.rb', line 35

def failure?
  !success?
end

#has_errors?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/act_form/runnable.rb', line 17

def has_errors?
  !errors.empty?
end

#performObject



29
# File 'lib/act_form/runnable.rb', line 29

def perform; end

#runObject



21
22
23
24
25
26
27
# File 'lib/act_form/runnable.rb', line 21

def run
  if valid?
    @result    = perform
    @performed = true
  end
  self
end

#success?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/act_form/runnable.rb', line 31

def success?
  !has_errors? && !!@performed
end