Sha256: a7eb90de50d43870e519563022079c14066f0f125fb3921bb63f183aad1e4de3

Contents?: true

Size: 405 Bytes

Versions: 25

Compression:

Stored size: 405 Bytes

Contents

class ExtensionFilter
  
  def initialize(file_class, extension)
    @file_class = file_class
    @extension = extension.downcase
  end
  
  def filter(file_name)
    return file_type(file_name) == @extension
  end

  # Return the part of the file name string after the last '.'
  def file_type(file_name)
    @file_class.extname(file_name).gsub( /^\./, '' ).downcase 
  end
  
  def complete
  end
  
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
karl-loris-0.0.10 lib/filters/extension_filter.rb
karl-loris-0.0.11 lib/filters/extension_filter.rb
loris-0.5.2 lib/filters/extension_filter.rb
loris-0.5.1 lib/filters/extension_filter.rb
loris-0.5.0 lib/filters/extension_filter.rb
loris-0.4.1 lib/filters/extension_filter.rb
loris-0.4.0 lib/filters/extension_filter.rb
loris-0.3.2 lib/filters/extension_filter.rb
loris-0.3.1 lib/filters/extension_filter.rb
loris-0.3.0 lib/filters/extension_filter.rb
loris-0.2.3 lib/filters/extension_filter.rb
loris-0.2.2 lib/filters/extension_filter.rb
loris-0.2.1 lib/filters/extension_filter.rb
loris-0.2.0 lib/filters/extension_filter.rb
loris-0.1.7 lib/filters/extension_filter.rb
loris-0.1.5 lib/filters/extension_filter.rb
loris-0.1.4 lib/filters/extension_filter.rb
loris-0.1.3 lib/filters/extension_filter.rb
loris-0.1.2 lib/filters/extension_filter.rb
loris-0.1.1 lib/filters/extension_filter.rb