Module: GraphdocRuby::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/graphdoc-ruby/utils.rb

Instance Method Summary collapse

Instance Method Details

#file_exist?(path) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/graphdoc-ruby/utils.rb', line 12

def file_exist?(path)
  File.exist?(path)
end

#valid_url?(url) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
# File 'lib/graphdoc-ruby/utils.rb', line 5

def valid_url?(url)
  uri = URI.parse(url)
  uri.host
rescue StandardError
  false
end