Sha256: 47830a49d11d30c174bae952abd27316013027e0d946c91a2b3eb2f95206c659

Contents?: true

Size: 319 Bytes

Versions: 1

Compression:

Stored size: 319 Bytes

Contents

module Superstore
  module Types
    class BooleanType < Base
      TRUE_VALS = [true, 'true', '1']
      FALSE_VALS = [false, 'false', '0']

      def cast_value(value)
        if TRUE_VALS.include?(value)
          true
        elsif FALSE_VALS.include?(value)
          false
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
superstore-3.0.0 lib/superstore/types/boolean_type.rb