Class: Daytona::FileUpload

Inherits:
Object
  • Object
show all
Defined in:
lib/daytona/common/file_system.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, destination) ⇒ FileUpload

Initializes a new FileUpload instance.

Parameters:

  • source (String, IO)

    File contents as a string/bytes object or a local file path or IO object.

  • destination (String)

    Absolute destination path in the Sandbox.



18
19
20
21
# File 'lib/daytona/common/file_system.rb', line 18

def initialize(source, destination)
  @source = source
  @destination = destination
end

Instance Attribute Details

#destinationString (readonly)

Returns Absolute destination path in the Sandbox. Relative paths are resolved based on the sandbox working directory.

Returns:

  • (String)

    Absolute destination path in the Sandbox. Relative paths are resolved based on the sandbox working directory.



12
13
14
# File 'lib/daytona/common/file_system.rb', line 12

def destination
  @destination
end

#sourceString, IO (readonly)

Returns File contents as a string/bytes object or a local file path or IO object. If a string path is provided, the file content will be read from disk. If a string content is provided, make sure it fits into memory.

Returns:

  • (String, IO)

    File contents as a string/bytes object or a local file path or IO object. If a string path is provided, the file content will be read from disk. If a string content is provided, make sure it fits into memory.



8
9
10
# File 'lib/daytona/common/file_system.rb', line 8

def source
  @source
end