Module: Spine::Transform::Syntax::Boolean

Included in:
Mapping
Defined in:
lib/spine/transform/syntax/boolean.rb

Constant Summary collapse

FALSES =
[nil, 0, false, 'f', 'false', '0'].freeze

Instance Method Summary collapse

Instance Method Details

#boolean(key, options = {}) ⇒ Object



7
8
9
10
11
12
# File 'lib/spine/transform/syntax/boolean.rb', line 7

def boolean(key, options = {})
  register(
    key,
    intercept(key, options) { |value| !FALSES.include?(value) }
  )
end