Module: Howitzer::Utils::PageValidator

Included in:
WebPage
Defined in:
lib/howitzer/utils/page_validator.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:


8
9
10
# File 'lib/howitzer/utils/page_validator.rb', line 8

def self.included(base)  #:nodoc:
  base.extend(ClassMethods)
end

.pagesArray

Returns page list


28
29
30
# File 'lib/howitzer/utils/page_validator.rb', line 28

def self.pages
  @pages ||= []
end

.validationsHash

Returns validation list


18
19
20
# File 'lib/howitzer/utils/page_validator.rb', line 18

def self.validations
  @validations
end

Instance Method Details

#check_validations_are_defined!Object

Check if any validations are defined, if no, tries to find old style, else raise error

Raises:


38
39
40
41
42
# File 'lib/howitzer/utils/page_validator.rb', line 38

def check_validations_are_defined!
  if validations.nil? && !old_url_validation_present?
    log.error Howitzer::NoValidationError, "No any page validation was found for '#{self.class.name}' page"
  end
end