Class: Desktop::HTTP

Inherits:
Object
  • Object
show all
Defined in:
lib/desktop/http.rb

Class Method Summary collapse

Class Method Details

.connectionObject



6
7
8
# File 'lib/desktop/http.rb', line 6

def self.connection
  Faraday
end

.uri?(path) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
# File 'lib/desktop/http.rb', line 10

def self.uri?(path)
  %w[http https].include? URI.parse(path).scheme
rescue URI::BadURIError, URI::InvalidURIError
  false
end