Method: Train::File#mounted?

Defined in:
lib/train/file.rb

#mounted?Boolean

if the OS-specific file class supports inquirying as to whether the file/device is mounted, the #mounted method should return a command object whose stdout will not be nil if indeed the device is mounted.

if the OS-specific file class does not support checking for mount status, the method should not be implemented and this method will return false.

Returns:

  • (Boolean)


128
129
130
131
132
# File 'lib/train/file.rb', line 128

def mounted?
  return false unless respond_to?(:mounted)

  !mounted.nil? && !mounted.stdout.nil? && !mounted.stdout.empty?
end