Sha256: 61029bfb8d2037a0f4213c5c2237e1eb7cdf6793472b849f29dc1089a28ec779

Contents?: true

Size: 268 Bytes

Versions: 6

Compression:

Stored size: 268 Bytes

Contents

# frozen_string_literal: true

# @api public
# @since 0.1.0
SmartCore::Types::Value.define_type(:Boolean) do |type|
  type.define_checker do |value|
    value.is_a?(::TrueClass) || value.is_a?(::FalseClass)
  end

  type.define_caster do |value|
    !!value
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
smart_types-0.2.0 lib/smart_core/types/value/boolean.rb
smart_types-0.1.0 lib/smart_core/types/value/boolean.rb
smart_types-0.1.0.alpha6 lib/smart_core/types/value/boolean.rb
smart_types-0.1.0.alpha5 lib/smart_core/types/value/boolean.rb
smart_types-0.1.0.alpha4 lib/smart_core/types/value/boolean.rb
smart_types-0.1.0.alpha3 lib/smart_core/types/value/boolean.rb