Sha256: 5cbba059dd81f04de814f3fb9e3386e2c3123bee75e4e7229835199f81e6a6ed

Contents?: true

Size: 344 Bytes

Versions: 1

Compression:

Stored size: 344 Bytes

Contents

module RestMan
  class Request
    module Init
      class Url
        class NormalizeUrl < ActiveMethod::Base
          argument :url

          def call
            if url.match(%r{\A[a-z][a-z0-9+.-]*://}i)
              url
            else
              "http://#{url}"
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rest-man-1.1.0 lib/restman/request/init/url/normalize_url.rb