Class: Train::Transports::Local::Connection::File
- Inherits:
-
LinuxFile
- Object
- LinuxFile
- Train::Transports::Local::Connection::File
- Defined in:
- lib/train/transports/local_file.rb
Instance Method Summary collapse
Instance Method Details
#block_device? ⇒ Boolean
29 30 31 |
# File 'lib/train/transports/local_file.rb', line 29 def block_device? ::File.blockdev?(@path) end |
#character_device? ⇒ Boolean
33 34 35 |
# File 'lib/train/transports/local_file.rb', line 33 def character_device? ::File.chardev?(@path) end |
#content ⇒ Object
10 11 12 13 14 |
# File 'lib/train/transports/local_file.rb', line 10 def content @content ||= ::File.read(@path, encoding: 'UTF-8') rescue StandardError => _ nil end |
#link_path ⇒ Object
24 25 26 27 |
# File 'lib/train/transports/local_file.rb', line 24 def link_path return nil unless symlink? @link_path ||= ::File.readlink(@path) end |