Class: CloudSesame::Query::Node::Sloppiness
- Defined in:
- lib/cloud_sesame/query/node/sloppiness.rb
Instance Method Summary collapse
- #compile(string) ⇒ Object
-
#initialize(value) ⇒ Sloppiness
constructor
A new instance of Sloppiness.
Constructor Details
#initialize(value) ⇒ Sloppiness
Returns a new instance of Sloppiness.
6 7 8 |
# File 'lib/cloud_sesame/query/node/sloppiness.rb', line 6 def initialize(value) @value = value.to_i end |
Instance Method Details
#compile(string) ⇒ Object
10 11 12 |
# File 'lib/cloud_sesame/query/node/sloppiness.rb', line 10 def compile(string) "\"#{ string }\"~#{ @value }" if more_than_one_word?(string) end |