Sha256: 848d081d1c167b1804e7583d801c249a1a2a9a4a06e4b6a23663c218d719586c

Contents?: true

Size: 262 Bytes

Versions: 12

Compression:

Stored size: 262 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

module DHS
  module IsHref
    extend ActiveSupport::Concern

    module ClassMethods
      def href?(input)
        input.is_a?(String) && %r{^https?://}.match(input).present?
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dhs-1.6.0 lib/dhs/concerns/is_href.rb
dhs-1.5.0 lib/dhs/concerns/is_href.rb
dhs-1.4.2 lib/dhs/concerns/is_href.rb
dhs-1.4.1 lib/dhs/concerns/is_href.rb
dhs-1.4.0 lib/dhs/concerns/is_href.rb
dhs-1.3.0 lib/dhs/concerns/is_href.rb
dhs-1.2.0 lib/dhs/concerns/is_href.rb
dhs-1.1.0 lib/dhs/concerns/is_href.rb
dhs-1.0.3 lib/dhs/concerns/is_href.rb
dhs-1.0.2 lib/dhs/concerns/is_href.rb
dhs-1.0.1 lib/dhs/concerns/is_href.rb
dhs-1.0.0 lib/dhs/concerns/is_href.rb