Class: Jets::Event::Helpers::S3Event::NamedFile

Inherits:
File
  • Object
show all
Extended by:
Memoist
Defined in:
lib/jets/event/helpers/s3_event.rb

Overview

The Ruby File handle does not store information about the filename. NamedFile includes the filename which is useful for downstream processing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_handle, filename) ⇒ NamedFile

Returns a new instance of NamedFile.



65
66
67
68
# File 'lib/jets/event/helpers/s3_event.rb', line 65

def initialize(file_handle, filename)
  @filename = filename
  super(file_handle, "r")
end

Instance Attribute Details

#filenameObject (readonly) Also known as: object_key

Returns the value of attribute filename.



61
62
63
# File 'lib/jets/event/helpers/s3_event.rb', line 61

def filename
  @filename
end

Instance Method Details

#contentObject



70
71
72
# File 'lib/jets/event/helpers/s3_event.rb', line 70

def content
  read
end