Class: Picky::Backends::Redis::Float
- Defined in:
- lib/picky/backends/redis/float.rb
Instance Method Summary collapse
-
#[](key) ⇒ Object
Get a single value.
Methods inherited from String
#double_metaphone, #each_intoken, #each_subtoken, #metaphone, #soundex
Instance Method Details
#[](key) ⇒ Object
Get a single value.
Internal API method for the index.
Note: Works like the StringHash method, but returns a float corresponding to that string.
Note: nil.to_f returns 0.0. That’s why the
code below looks a bit funny.
19 20 21 22 |
# File 'lib/picky/backends/redis/float.rb', line 19 def [] key float = super float && float.to_f end |