Class: VectorEmbed::Maker::Boolean
- Inherits:
-
VectorEmbed::Maker
- Object
- VectorEmbed::Maker
- VectorEmbed::Maker::Boolean
- Defined in:
- lib/vector_embed/maker/boolean.rb
Instance Attribute Summary
Attributes inherited from VectorEmbed::Maker
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from VectorEmbed::Maker
Constructor Details
This class inherits a constructor from VectorEmbed::Maker
Class Method Details
Instance Method Details
#pairs(v) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/vector_embed/maker/boolean.rb', line 28 def pairs(v) case v when TrueClass, TRUE, T [ [ parent.index([k, 'true']), 1 ] ] when FalseClass, FALSE, F [ [ parent.index([k, 'false']), 1 ] ] when NilClass, NULL, SLASH_N, BLANK [ [ parent.index([k, 'null']), 1 ] ] else raise ArgumentError, "Can't embed #{v.inspect} in boolean feature #{k.inspect}" end end |