Class: Wsv::Response::StringBody
- Inherits:
-
Object
- Object
- Wsv::Response::StringBody
- Defined in:
- lib/wsv/response/string_body.rb
Instance Method Summary collapse
- #bytesize ⇒ Object
-
#initialize(string) ⇒ StringBody
constructor
A new instance of StringBody.
- #to_s ⇒ Object
- #write_to(io) ⇒ Object
Constructor Details
#initialize(string) ⇒ StringBody
Returns a new instance of StringBody.
6 7 8 |
# File 'lib/wsv/response/string_body.rb', line 6 def initialize(string) @string = string end |
Instance Method Details
#bytesize ⇒ Object
14 15 16 |
# File 'lib/wsv/response/string_body.rb', line 14 def bytesize @string.bytesize end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/wsv/response/string_body.rb', line 10 def to_s @string end |
#write_to(io) ⇒ Object
18 19 20 |
# File 'lib/wsv/response/string_body.rb', line 18 def write_to(io) io.write(@string) unless @string.empty? end |