Class: TXTextControl::ReportingCloud::TemplateDataValidator

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

Overview

Internal method parameter validator class.

Author:

  • Thorsten Kummerow (@thomerow)

Class Method Summary collapse

Class Method Details

.validate(template_data) ⇒ Boolean

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

Parameters:

  • template_data (String)

    The string to validate.

Returns:

  • (Boolean)

Raises:

  • (ArgumentError)


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

def self.validate(template_data)
  raise ArgumentError, "Template data must be a Base64 encoded string." if !template_data.kind_of? String
  raise ArgumentError, "No template data given." if template_data.to_s.empty?
end