Class: ZSTDS::Validation

Inherits:
ADSP::Validation
  • Object
show all
Defined in:
lib/zstds/validation.rb

Overview

ZSTDS::Validation class.

Class Method Summary collapse

Class Method Details

.validate_bool(value) ⇒ Object

Raises error when value is not boolean.

Raises:



10
11
12
# File 'lib/zstds/validation.rb', line 10

def self.validate_bool(value)
  raise ValidateError, "invalid bool" unless value.is_a?(::TrueClass) || value.is_a?(::FalseClass)
end

.validate_integer(value) ⇒ Object

Raises error when value is not integer.

Raises:



15
16
17
# File 'lib/zstds/validation.rb', line 15

def self.validate_integer(value)
  raise ValidateError, "invalid integer" unless value.is_a? ::Integer
end