Module: HTTP::FormData::Readable
- Included in:
- Multipart, Multipart::Param, Part, Urlencoded
- Defined in:
- lib/http/form_data/readable.rb
Overview
Common behaviour for objects defined by an IO object.
Instance Method Summary collapse
-
#read(length = nil, outbuf = nil) ⇒ String?
Reads and returns part of IO content.
-
#rewind ⇒ Object
Rewinds the IO.
-
#size ⇒ Integer
Returns IO size.
-
#to_s ⇒ String
Returns IO content.
Instance Method Details
#read(length = nil, outbuf = nil) ⇒ String?
Reads and returns part of IO content.
21 22 23 |
# File 'lib/http/form_data/readable.rb', line 21 def read(length = nil, outbuf = nil) @io.read(length, outbuf) end |
#rewind ⇒ Object
Rewinds the IO.
33 34 35 |
# File 'lib/http/form_data/readable.rb', line 33 def rewind @io.rewind end |
#size ⇒ Integer
Returns IO size.
28 29 30 |
# File 'lib/http/form_data/readable.rb', line 28 def size @io.size end |
#to_s ⇒ String
Returns IO content.
10 11 12 13 |
# File 'lib/http/form_data/readable.rb', line 10 def to_s rewind read end |