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.



21
22
23
24
# File 'lib/daytona/common/file_system.rb', line 21

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.



15
16
17
# File 'lib/daytona/common/file_system.rb', line 15

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.



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

def source
  @source
end