module SimpleCommand

Constants

VERSION

Attributes

result[R]

Public Class Methods

prepended(base) click to toggle source
# File lib/simple_command.rb, line 13
def self.prepended(base)
  base.extend ClassMethods
end

Public Instance Methods

call() click to toggle source
Calls superclass method
# File lib/simple_command.rb, line 17
def call
  fail NotImplementedError unless defined?(super)

  @called = true
  @result = super

  self
end
errors() click to toggle source
Calls superclass method
# File lib/simple_command.rb, line 35
def errors
  return super if defined?(super)

  @errors ||= Errors.new
end
failure?() click to toggle source
# File lib/simple_command.rb, line 31
def failure?
  called? && errors.any?
end
success?() click to toggle source
# File lib/simple_command.rb, line 26
def success?
  called? && !failure?
end
Also aliased as: successful?
successful?()
Alias for: success?

Private Instance Methods

called?() click to toggle source
# File lib/simple_command.rb, line 43
def called?
  @called ||= false
end