class Writer

class Writer

lib/io/writer.tya:2

Writer provides the io/Writer standard library API.

Source
# Writer provides the io/Writer standard library API.
class Writer implements Writable, Flushable, Closable
  # Writer.binary stores instance state.
  # @type Nil
  binary: nil

  # Writer.handle stores instance state.
  # @type Nil
  handle: nil

  # Writer.initialize provides the io/Writer standard library operation.
  # @param handle Any handle value.
  # @param binary Boolean binary value.
  # @return Self the initialized object.
  initialize: handle, binary ->
    self.handle = handle
    self.binary = binary

  # Writer.close provides the io/Writer standard library operation.
  # @return Nil the resulting value.
  close: ->
    io_stream_close(self.handle)

  # Writer.flush provides the io/Writer standard library operation.
  # @return Nil the resulting value.
  flush: ->
    io_stream_flush(self.handle)

  # Writer.write provides the io/Writer standard library operation.
  # @param value String value value.
  # @return Any the resulting value.
  write: value ->
    io_stream_write(self.handle, value)

  # Writer.write_line provides the io/Writer standard library operation.
  # @param value String value value.
  # @return Any the resulting value.
  write_line: value ->
    self.write(value)
    self.write("\n")

Instance Variables

binary

Writer.binary

lib/io/writer.tya:5

Writer.binary stores instance state.

Source
  # Writer.binary stores instance state.
  # @type Nil
  binary: nil

handle

Writer.handle

lib/io/writer.tya:9

Writer.handle stores instance state.

Source
  # Writer.handle stores instance state.
  # @type Nil
  handle: nil

Methods

close

Writer.close()

lib/io/writer.tya:21

Writer.close provides the io/Writer standard library operation.

Source
  # Writer.close provides the io/Writer standard library operation.
  # @return Nil the resulting value.
  close: ->
    io_stream_close(self.handle)

flush

Writer.flush()

lib/io/writer.tya:26

Writer.flush provides the io/Writer standard library operation.

Source
  # Writer.flush provides the io/Writer standard library operation.
  # @return Nil the resulting value.
  flush: ->
    io_stream_flush(self.handle)

initialize

Writer.initialize(handle, binary)

lib/io/writer.tya:15

Writer.initialize provides the io/Writer standard library operation.

Source
  # Writer.initialize provides the io/Writer standard library operation.
  # @param handle Any handle value.
  # @param binary Boolean binary value.
  # @return Self the initialized object.
  initialize: handle, binary ->
    self.handle = handle
    self.binary = binary

write

Writer.write(value)

lib/io/writer.tya:32

Writer.write provides the io/Writer standard library operation.

Source
  # Writer.write provides the io/Writer standard library operation.
  # @param value String value value.
  # @return Any the resulting value.
  write: value ->
    io_stream_write(self.handle, value)

write_line

Writer.write_line(value)

lib/io/writer.tya:38

Writer.write_line provides the io/Writer standard library operation.

Source
  # Writer.write_line provides the io/Writer standard library operation.
  # @param value String value value.
  # @return Any the resulting value.
  write_line: value ->
    self.write(value)
    self.write("\n")