Class: MemDB::Idx::Pattern

Inherits:
Object
  • Object
show all
Includes:
MemDB::Idx
Defined in:
lib/mem_db/idx/pattern.rb

Defined Under Namespace

Classes: Pattern

Constant Summary

Constants included from MemDB::Idx

ANY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MemDB::Idx

#default, #default_any, #downcase, #prepare_query, #value

Constructor Details

#initialize(field, min: 3) ⇒ Pattern

Returns a new instance of Pattern.



57
58
59
60
# File 'lib/mem_db/idx/pattern.rb', line 57

def initialize(field, min: 3)
  @field = field
  @min = min
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



55
56
57
# File 'lib/mem_db/idx/pattern.rb', line 55

def field
  @field
end

Instance Method Details

#map_query(text) ⇒ Object



66
67
68
# File 'lib/mem_db/idx/pattern.rb', line 66

def map_query(text)
  text
end

#map_value(pattern) ⇒ Object



62
63
64
# File 'lib/mem_db/idx/pattern.rb', line 62

def map_value(pattern)
  Pattern.new(pattern, min: @min).value
end