Sha256: 7449b4a9f0be250866626bd87eceb4649cd276b18a8851aa37cf9ba71320c571

Contents?: true

Size: 204 Bytes

Versions: 4

Compression:

Stored size: 204 Bytes

Contents

# frozen_string_literal: true

class BooleanValidator < BaseValidator

  VALUES ||= %w[
    1 0 t f true false
  ].freeze

  private

  def valid_attr?
    VALUES.include?(value.to_s.downcase)
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lite-validators-1.0.3 lib/lite/validators/boolean_validator.rb
lite-validators-1.0.2 lib/lite/validators/boolean_validator.rb
lite-validators-1.0.1 lib/lite/validators/boolean_validator.rb
lite-validators-1.0.0 lib/lite/validators/boolean_validator.rb