Method: Lifer::Entry.supported?

Defined in:
lib/lifer/entry.rb

.supported?(filename, file_extensions = supported_file_extensions) ⇒ Boolean

Checks whether the given filename is supported entry type (using only its file extension).

Parameters:

  • filename (String)

    The absolute filename to an entry.

  • file_extensions (Array<String>) (defaults to: supported_file_extensions)

    An array of file extensions to check against.

Returns:

  • (Boolean)


89
90
91
# File 'lib/lifer/entry.rb', line 89

def supported?(filename, file_extensions= supported_file_extensions)
  file_extensions.any? { |ext| filename.end_with? ext }
end