Module: Rwc::Concerns::ErrorHandling::Validatable

Defined in:
lib/rwc/concerns/error_handling.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Includes core error handling functionality and class methods.

Parameters:

  • base (Class)

    The class to include the module in.



67
68
69
70
# File 'lib/rwc/concerns/error_handling.rb', line 67

def self.included(base)
  base.include(Core)
  base.extend(ClassMethods)
end

Instance Method Details

#raise_error!(message) ⇒ Object

Raises a service error with the specified message.

Parameters:

  • message (String)

    The error message to raise.

Raises:

  • (BaseService::ServiceError)

    The raised error.



76
77
78
# File 'lib/rwc/concerns/error_handling.rb', line 76

def raise_error!(message)
  raise ServiceError, message
end

#should_run_checks?Boolean

Checks if validation checks should be performed.

Returns:

  • (Boolean)

    True if checks should be performed; otherwise, false.



60
61
62
# File 'lib/rwc/concerns/error_handling.rb', line 60

def should_run_checks?
  self.class.should_run_checks
end