Class: Knjappserver::CustomIO
- Inherits:
-
StringIO
- Object
- StringIO
- Knjappserver::CustomIO
- Defined in:
- lib/include/class_customio.rb
Instance Method Summary collapse
- #print(str) ⇒ Object (also: #<<, #write, #p)
- #puts(str) ⇒ Object
Instance Method Details
#print(str) ⇒ Object Also known as: <<, write, p
2 3 4 5 6 7 8 9 10 11 12 |
# File 'lib/include/class_customio.rb', line 2 def print(str) str = str.to_s appsrv = Thread.current[:knjappserver] if appsrv and cgroup = appsrv[:contentgroup] and httpsession = appsrv[:httpsession] httpsession.add_size(str.size) cgroup.write(str) else STDOUT.print(str) if !STDOUT.closed? end end |
#puts(str) ⇒ Object
14 15 16 17 18 |
# File 'lib/include/class_customio.rb', line 14 def puts(str) res = self.print(str) self.print "\n" return res end |