Class: Primate::UploadedFile

Inherits:
Object
  • Object
show all
Defined in:
lib/primate/uploaded_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field:, name:, type:, size:, bytes:) ⇒ UploadedFile

Returns a new instance of UploadedFile.



9
10
11
12
13
14
15
# File 'lib/primate/uploaded_file.rb', line 9

def initialize(field:, name:, type:, size:, bytes:)
  @field = field
  @filename = name
  @content_type = type
  @size = size
  @io = Primate::Readable.new(bytes, type)
end

Instance Attribute Details

#content_typeObject (readonly)

Returns the value of attribute content_type.



7
8
9
# File 'lib/primate/uploaded_file.rb', line 7

def content_type
  @content_type
end

#fieldObject (readonly)

Returns the value of attribute field.



7
8
9
# File 'lib/primate/uploaded_file.rb', line 7

def field
  @field
end

#filenameObject (readonly)

Returns the value of attribute filename.



7
8
9
# File 'lib/primate/uploaded_file.rb', line 7

def filename
  @filename
end

#sizeObject (readonly)

Returns the value of attribute size.



7
8
9
# File 'lib/primate/uploaded_file.rb', line 7

def size
  @size
end

Instance Method Details

#ioObject



17
# File 'lib/primate/uploaded_file.rb', line 17

def io = @io