Class: StartsWithFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/filters/starts_with_filter.rb

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ StartsWithFilter

Returns a new instance of StartsWithFilter.



6
7
8
# File 'lib/filters/starts_with_filter.rb', line 6

def initialize(text)
  @text = text.downcase
end

Instance Method Details

#completeObject



14
15
# File 'lib/filters/starts_with_filter.rb', line 14

def complete
end

#filter(file_name) ⇒ Object



10
11
12
# File 'lib/filters/starts_with_filter.rb', line 10

def filter(file_name)
  return file_name.downcase.starts_with?(@text)
end