Class: OmniAI::Tools::Disk::BaseDriver

Inherits:
Object
  • Object
show all
Defined in:
lib/omniai/tools/disk/base_driver.rb

Overview

A driver for interacting with a disk via various operations

Direct Known Subclasses

LocalDriver

Instance Method Summary collapse

Constructor Details

#initialize(root:) ⇒ BaseDriver

Returns a new instance of BaseDriver.

Parameters:

  • root (String)


11
12
13
# File 'lib/omniai/tools/disk/base_driver.rb', line 11

def initialize(root:)
  @root = Pathname(root)
end

Instance Method Details

#directory_create(path:) ⇒ Object

Parameters:

  • path (String)

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/omniai/tools/disk/base_driver.rb', line 16

def directory_create(path:)
  raise NotImplementedError, "#{self.class}#{__method__} undefined"
end

#directory_move(path:, destination:) ⇒ Object

Parameters:

  • path (String)
  • destination (String)

Raises:

  • (NotImplementedError)


27
28
29
# File 'lib/omniai/tools/disk/base_driver.rb', line 27

def directory_move(path:, destination:)
  raise NotImplementedError, "#{self.class}#{__method__} undefined"
end

#directroy_delete(path:) ⇒ Object

Parameters:

  • path (String)

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/omniai/tools/disk/base_driver.rb', line 21

def directroy_delete(path:)
  raise NotImplementedError, "#{self.class}#{__method__} undefined"
end

#file_create(path:) ⇒ Object

Parameters:

  • path (String)

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/omniai/tools/disk/base_driver.rb', line 32

def file_create(path:)
  raise NotImplementedError, "#{self.class}#{__method__} undefined"
end

#file_delete(path:) ⇒ Object

Parameters:

  • path (String)

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/omniai/tools/disk/base_driver.rb', line 37

def file_delete(path:)
  raise NotImplementedError, "#{self.class}#{__method__} undefined"
end

#file_move(path:, destination:) ⇒ Object

Parameters:

  • path (String)
  • destination (String)

Raises:

  • (NotImplementedError)


43
44
45
# File 'lib/omniai/tools/disk/base_driver.rb', line 43

def file_move(path:, destination:)
  raise NotImplementedError, "#{self.class}#{__method__} undefined"
end

#file_read(path:) ⇒ String

Parameters:

  • path (String)

Returns:

  • (String)

Raises:

  • (NotImplementedError)


49
50
51
# File 'lib/omniai/tools/disk/base_driver.rb', line 49

def file_read(path:)
  raise NotImplementedError, "#{self.class}#{__method__} undefined"
end

#file_replace(old_text:, new_text:, path:) ⇒ Object

Parameters:

  • old_text (String)
  • new_text (String)
  • path (String)

Raises:

  • (NotImplementedError)


56
57
58
# File 'lib/omniai/tools/disk/base_driver.rb', line 56

def file_replace(old_text:, new_text:, path:)
  raise NotImplementedError, "#{self.class}#{__method__} undefined"
end

#file_write(path:, text:) ⇒ Object

Parameters:

  • path (String)
  • text (String)

Raises:

  • (NotImplementedError)


62
63
64
# File 'lib/omniai/tools/disk/base_driver.rb', line 62

def file_write(path:, text:)
  raise NotImplementedError, "#{self.class}#{__method__} undefined"
end