Class: MemDB::Field::Pattern::Pattern::Prefix
- Inherits:
-
Object
- Object
- MemDB::Field::Pattern::Pattern::Prefix
- Defined in:
- lib/mem_db/field/pattern.rb
Instance Method Summary collapse
-
#initialize(prefix) ⇒ Prefix
constructor
A new instance of Prefix.
- #match?(str) ⇒ Boolean
Constructor Details
#initialize(prefix) ⇒ Prefix
Returns a new instance of Prefix.
39 40 41 |
# File 'lib/mem_db/field/pattern.rb', line 39 def initialize(prefix) @prefix = prefix end |
Instance Method Details
#match?(str) ⇒ Boolean
43 44 45 |
# File 'lib/mem_db/field/pattern.rb', line 43 def match?(str) str.start_with?(@prefix) end |