module Howitzer::Web::PageValidator

This module combines page validation methods

Public Class Methods

validations() click to toggle source

@return [Hash] defined validations for all page classes

# File lib/howitzer/web/page_validator.rb, line 15
def self.validations
  @validations ||= {}
end

Public Instance Methods

check_validations_are_defined!() click to toggle source

Checks if any validations are defined for the page @raise [Howitzer::NoValidationError] if no one validation is defined for the page

# File lib/howitzer/web/page_validator.rb, line 22
def check_validations_are_defined!
  return if self.class.validations.present?

  raise Howitzer::NoValidationError, "No any page validation was found for '#{self.class.name}' page"
end