Class: EndsWithFilter

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

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ EndsWithFilter

Returns a new instance of EndsWithFilter.



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

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

Instance Method Details

#completeObject



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

def complete
end

#filter(file_name) ⇒ Object



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

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