Class: ROCrate::RemoteEntry
- Defined in:
- lib/ro_crate/model/remote_entry.rb
Overview
A class to represent a reference within an RO-Crate, to a remote file held on the internet somewhere. It handles the actual reading/writing of bytes.
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#directory? ⇒ Boolean
Does this RemoteEntry point to a directory.
-
#initialize(uri, directory: false) ⇒ RemoteEntry
constructor
Create a new RemoteEntry.
-
#remote? ⇒ Boolean
Does this RemoteEntry point to a remote resource?.
-
#source ⇒ IO
An IO object for the remote resource.
-
#symlink? ⇒ Boolean
Does this RemoteEntry point to a symlink.
Methods inherited from Entry
Constructor Details
#initialize(uri, directory: false) ⇒ RemoteEntry
Create a new RemoteEntry.
12 13 14 15 |
# File 'lib/ro_crate/model/remote_entry.rb', line 12 def initialize(uri, directory: false) @uri = uri @directory = directory end |
Instance Attribute Details
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
6 7 8 |
# File 'lib/ro_crate/model/remote_entry.rb', line 6 def uri @uri end |
Instance Method Details
#directory? ⇒ Boolean
Does this RemoteEntry point to a directory
26 27 28 |
# File 'lib/ro_crate/model/remote_entry.rb', line 26 def directory? @directory end |
#remote? ⇒ Boolean
Does this RemoteEntry point to a remote resource?
38 39 40 |
# File 'lib/ro_crate/model/remote_entry.rb', line 38 def remote? true end |
#source ⇒ IO
Returns An IO object for the remote resource.
20 21 22 |
# File 'lib/ro_crate/model/remote_entry.rb', line 20 def source uri.open end |
#symlink? ⇒ Boolean
Does this RemoteEntry point to a symlink
32 33 34 |
# File 'lib/ro_crate/model/remote_entry.rb', line 32 def symlink? false end |