Class: URI::File

Inherits:
Generic
  • Object
show all
Defined in:
lib/json-schema/uri/file.rb

Overview

Ruby does not have built-in support for filesystem URIs, and definitely does not have built-in support for using open-uri with filesystem URIs

Constant Summary collapse

COMPONENT =
[
  :scheme,  
  :path, 
  :fragment,
  :host
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*arg) ⇒ File

Returns a new instance of File.



16
17
18
19
# File 'lib/json-schema/uri/file.rb', line 16

def initialize(*arg)
  arg[2] = ""
  super(*arg)
end

Class Method Details

.build(args) ⇒ Object



21
22
23
24
# File 'lib/json-schema/uri/file.rb', line 21

def self.build(args)
  tmp = Util::make_components_hash(self, args)
  return super(tmp)
end

Instance Method Details

#open(*rest, &block) ⇒ Object



26
27
28
# File 'lib/json-schema/uri/file.rb', line 26

def open(*rest, &block)
  ::File.open(self.path, *rest, &block)
end