Class: TXTextControl::ReportingCloud::TemplateNameValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/txtextcontrol/reportingcloud/template_name_validator.rb

Overview

Internal method parameter validator class.

Author:

  • Thorsten Kummerow (@thomerow)

Class Method Summary collapse

Class Method Details

.validate(template_name) ⇒ Boolean

Checks if a given value is a String, is not nil and not empty.

Parameters:

  • template_name (String)

    The string to validate.

Returns:

  • (Boolean)

Raises:

  • (ArgumentError)


24
25
26
27
# File 'lib/txtextcontrol/reportingcloud/template_name_validator.rb', line 24

def self.validate(template_name)
  raise ArgumentError, "Template name must be a String." if !template_name.kind_of? String 
  raise ArgumentError, "No template name given." if template_name.to_s.empty?
end