Class: CloudSesame::Query::Node::Sloppiness

Inherits:
Object
  • Object
show all
Defined in:
lib/cloud_sesame/query/node/sloppiness.rb

Instance Method Summary collapse

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