Class: Tensorflow::Datasets::Resource
- Inherits:
-
Object
- Object
- Tensorflow::Datasets::Resource
- Defined in:
- lib/datasets/resource.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #filename ⇒ Object
-
#initialize(url) ⇒ Resource
constructor
A new instance of Resource.
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
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/datasets/resource.rb', line 7 def path @path end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
6 7 8 |
# File 'lib/datasets/resource.rb', line 6 def uri @uri end |
Instance Method Details
#filename ⇒ Object
13 14 15 |
# File 'lib/datasets/resource.rb', line 13 def filename File.basename(self.uri.path) end |