Class: Primate::UploadedFile
- Inherits:
-
Object
- Object
- Primate::UploadedFile
- Defined in:
- lib/primate/uploaded_file.rb,
sig/primate.rbs
Instance Attribute Summary collapse
-
#content_type ⇒ String
readonly
Returns the value of attribute content_type.
-
#field ⇒ String
readonly
Returns the value of attribute field.
-
#filename ⇒ String
readonly
Returns the value of attribute filename.
-
#size ⇒ Integer
readonly
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize(field:, name:, type:, size:, bytes:) ⇒ UploadedFile
constructor
A new instance of UploadedFile.
- #io ⇒ Readable
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_type ⇒ String (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 |
#field ⇒ String (readonly)
Returns the value of attribute field.
7 8 9 |
# File 'lib/primate/uploaded_file.rb', line 7 def field @field end |
#filename ⇒ String (readonly)
Returns the value of attribute filename.
7 8 9 |
# File 'lib/primate/uploaded_file.rb', line 7 def filename @filename end |
#size ⇒ Integer (readonly)
Returns the value of attribute size.
7 8 9 |
# File 'lib/primate/uploaded_file.rb', line 7 def size @size end |