Class: RubyAPI::UploadedFile

Inherits:
Object
  • Object
show all
Defined in:
lib/fastrb/context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename:, type:, tempfile:) ⇒ UploadedFile

Returns a new instance of UploadedFile.



167
168
169
170
171
# File 'lib/fastrb/context.rb', line 167

def initialize(filename:, type:, tempfile:)
  @filename = filename
  @type = type
  @tempfile = tempfile
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



165
166
167
# File 'lib/fastrb/context.rb', line 165

def filename
  @filename
end

#tempfileObject (readonly)

Returns the value of attribute tempfile.



165
166
167
# File 'lib/fastrb/context.rb', line 165

def tempfile
  @tempfile
end

#typeObject (readonly)

Returns the value of attribute type.



165
166
167
# File 'lib/fastrb/context.rb', line 165

def type
  @type
end

Instance Method Details

#readObject



173
174
175
# File 'lib/fastrb/context.rb', line 173

def read
  @tempfile.read
end

#rewindObject



177
178
179
# File 'lib/fastrb/context.rb', line 177

def rewind
  @tempfile.rewind
end