Module: Miteru::Mixins::URL

Defined in:
lib/miteru/mixin.rb

Constant Summary collapse

IGNORE_EXTENSIONS =
%w[.htm .html .php .asp .aspx .exe .txt].freeze

Instance Method Summary collapse

Instance Method Details

#invalid_extension?(url) ⇒ Boolean

Validate extension of a URL

Parameters:

  • url (String)

Returns:

  • (Boolean)


15
16
17
# File 'lib/miteru/mixin.rb', line 15

def invalid_extension?(url)
  IGNORE_EXTENSIONS.any? { |ext| url.end_with? ext }
end