Class: BucketSdk::Models::LoadRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/bucket_sdk/models/load_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file:, destination:) ⇒ LoadRequest

Initialize a new LoadRequest

Parameters:

  • file (File, String)

    The file to upload (either a File object or a path to a file)

  • destination (String)

    The destination path in the bucket



11
12
13
14
# File 'lib/bucket_sdk/models/load_request.rb', line 11

def initialize(file:, destination:)
  @file = file
  @destination = destination
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



6
7
8
# File 'lib/bucket_sdk/models/load_request.rb', line 6

def destination
  @destination
end

#fileObject (readonly)

Returns the value of attribute file.



6
7
8
# File 'lib/bucket_sdk/models/load_request.rb', line 6

def file
  @file
end

Instance Method Details

#to_hObject



16
17
18
19
20
21
# File 'lib/bucket_sdk/models/load_request.rb', line 16

def to_h
  {
    file: file,
    destination: destination
  }
end