Class: Mooncell::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/mooncell/connection.rb

Overview

The connection wrapper

Since:

  • 0.1.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io, app) ⇒ Connection

Create a connection

Parameters:

  • io (#write)

    the writable I/O

Since:

  • 0.1.0



17
18
19
20
21
22
# File 'lib/mooncell/connection.rb', line 17

def initialize(io, app)
  @io = io
  @app = app

  prepare
end

Instance Attribute Details

#appObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



10
11
12
# File 'lib/mooncell/connection.rb', line 10

def app
  @app
end

Instance Method Details

#write(data) ⇒ Object

Write data

Parameters:

  • data

    the data to write

Since:

  • 0.1.0



29
30
31
# File 'lib/mooncell/connection.rb', line 29

def write(data)
  io.write(data)
end