Class: Primate::UploadedFile
- Inherits:
-
Object
- Object
- Primate::UploadedFile
- Defined in:
- lib/primate/uploaded_file.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#size ⇒ Object
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 ⇒ Object
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 ⇒ Object (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 ⇒ Object (readonly)
Returns the value of attribute field.
7 8 9 |
# File 'lib/primate/uploaded_file.rb', line 7 def field @field end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
7 8 9 |
# File 'lib/primate/uploaded_file.rb', line 7 def filename @filename end |
#size ⇒ Object (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
#io ⇒ Object
17 |
# File 'lib/primate/uploaded_file.rb', line 17 def io = @io |