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.
23 24 25 |
# File 'lib/http/form_data/readable.rb', line 23 def read(length = nil, outbuf = nil) @io.read(length, outbuf) end |
#rewind ⇒ Object
Rewinds the IO.
35 36 37 |
# File 'lib/http/form_data/readable.rb', line 35 def rewind @io.rewind end |
#size ⇒ Integer
Returns IO size.
30 31 32 |
# File 'lib/http/form_data/readable.rb', line 30 def size @io.size end |
#to_s ⇒ String
Returns IO content.
10 11 12 13 14 15 |
# File 'lib/http/form_data/readable.rb', line 10 def to_s rewind content = read rewind content end |