class Zeli::Parser::UrlParser

Public Instance Methods

parse!(raw_curl, curl) click to toggle source
# File lib/zeli/parsers/url_parser.rb, line 4
def parse!(raw_curl, curl)
  @raw_curl = raw_curl
  @curl = curl

  @curl.url = value
end

Private Instance Methods

value() click to toggle source
# File lib/zeli/parsers/url_parser.rb, line 13
def value
  value = @raw_curl.slice(/(https:\/\/|http:\/\/|localhost:).*(?=\s)/)
  value = value[0..-2] if !value.nil? && value.end_with?('\\')

  URI(value)
end