Class: Neighbor::Type::Halfvec
- Inherits:
-
ActiveRecord::Type::Value
- Object
- ActiveRecord::Type::Value
- Neighbor::Type::Halfvec
- Defined in:
- lib/neighbor/type/halfvec.rb
Instance Method Summary collapse
Instance Method Details
#serialize(value) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/neighbor/type/halfvec.rb', line 8 def serialize(value) if Utils.array?(value) value = "[#{value.to_a.map(&:to_f).join(",")}]" end super(value) end |
#type ⇒ Object
4 5 6 |
# File 'lib/neighbor/type/halfvec.rb', line 4 def type :halfvec end |