Class: Sinatra::Helpers::Stream
- Inherits:
-
Object
- Object
- Sinatra::Helpers::Stream
- Defined in:
- app/openbel/api/helpers/translators.rb
Overview
Instance Method Summary collapse
-
#flush ⇒ Object
flush is a no-op; flushing is handled by sinatra/rack server.
-
#puts(*args) ⇒ Object
Write each string in +args*, new-line delimited, to the stream.
-
#write(string) ⇒ Object
Write the string to the stream.
Instance Method Details
#flush ⇒ Object
flush is a no-op; flushing is handled by sinatra/rack server
28 |
# File 'app/openbel/api/helpers/translators.rb', line 28 def flush; end |
#puts(*args) ⇒ Object
Write each string in +args*, new-line delimited, to the stream.
16 17 18 19 20 |
# File 'app/openbel/api/helpers/translators.rb', line 16 def puts(*args) self << ( args.map { |string| "#{string.encode(Encoding::UTF_8)}\n" }.join ) end |
#write(string) ⇒ Object
Write the string to the stream.
23 24 25 |
# File 'app/openbel/api/helpers/translators.rb', line 23 def write(string) self << string.encode(Encoding::UTF_8) end |