Class: Tensorflow::Datasets::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/datasets/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Resource

Returns a new instance of Resource.



9
10
11
# File 'lib/datasets/resource.rb', line 9

def initialize(url)
  @uri = url.is_a?(URI) ? url : URI.parse(url)
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



7
8
9
# File 'lib/datasets/resource.rb', line 7

def path
  @path
end

#uriObject (readonly)

Returns the value of attribute uri.



6
7
8
# File 'lib/datasets/resource.rb', line 6

def uri
  @uri
end

Instance Method Details

#filenameObject



13
14
15
# File 'lib/datasets/resource.rb', line 13

def filename
  File.basename(self.uri.path)
end