Class: S3DataPacker::Targets::Object

Inherits:
Object
  • Object
show all
Defined in:
lib/s3_data_packer/targets/object.rb

Instance Method Summary collapse

Constructor Details

#initialize(object:, name_method: :each, save_file_method: :save_file) ⇒ Object

Returns a new instance of Object.



5
6
7
8
9
# File 'lib/s3_data_packer/targets/object.rb', line 5

def initialize(object:, name_method: :each, save_file_method: :save_file)
  @object = object
  @name_method = name_method
  @save_file_method = save_file_method
end

Instance Method Details

#nameObject



11
12
13
# File 'lib/s3_data_packer/targets/object.rb', line 11

def name
  @object.send(@name_method)
end

#save_file(filepath) ⇒ Object



15
16
17
# File 'lib/s3_data_packer/targets/object.rb', line 15

def save_file(filepath)
  @object.send(@save_file_method, filepath)
end