### Home Classes Methods

### In Files

- lib/cool.io/dsl.rb

### Parent

Object

### Methods

- ::new
- #initializer
- #on_close
- #on_connect
- #on_connect_failed
- #on_read
- #on_resolve_failed
- #on_write_complete

### Class/Module Index

Quicksearch

- Coolio
- Coolio::AsyncWatcher
- Coolio::Connections
- Coolio::DNSResolver
- Coolio::DNSResolver::Timeout
- Coolio::DSL
- Coolio::DSL::ConnectionBuilder
- Coolio::IO
- Coolio::IO::Watcher
- Coolio::IOWatcher
- Coolio::Listener
- Coolio::Loop
- Coolio::Meta
- Coolio::Server
- Coolio::Socket
- Coolio::Socket::Connector
- Coolio::TCPListener
- Coolio::TCPServer
- Coolio::TCPSocket
- Coolio::TCPSocket::TCPConnectResolver
- Coolio::TCPSocket::TCPConnectSocket
- Coolio::TimerWatcher
- Coolio::UNIXListener
- Coolio::UNIXServer
- Coolio::UNIXSocket
- Cool
- Cool::Coolness
- Cool::IOThunk
- Object
- Thread

No matching classes.

# Coolio::DSL::ConnectionBuilder

Builder for Cool.io::TCPSocket classes

### Public Class Methods

new(klass) click to toggle source

    # File lib/cool.io/dsl.rb, line 82
    def initialize(klass)
      @klass = klass
    end

### Public Instance Methods

initializer(&action) click to toggle source

Declare an initialize function

    # File lib/cool.io/dsl.rb, line 87
    def initializer(&action)
      @klass.send :define_method, :initialize, &action
    end

on_close(&action) click to toggle source

Declare the on_close callback

    # File lib/cool.io/dsl.rb, line 107
    def on_close(&action)
      @klass.send :define_method, :on_close, &action
    end

on_connect(&action) click to toggle source

Declare the on_connect callback

    # File lib/cool.io/dsl.rb, line 92
    def on_connect(&action)
      @klass.send :define_method, :on_connect, &action
    end

on_connect_failed(&action) click to toggle source

Declare a callback fired if we failed to connect

    # File lib/cool.io/dsl.rb, line 97
    def on_connect_failed(&action)
      @klass.send :define_method, :on_connect_failed, &action
    end

on_read(&action) click to toggle source

Declare the on_read callback

    # File lib/cool.io/dsl.rb, line 112
    def on_read(&action)
      @klass.send :define_method, :on_read, &action
    end

on_resolve_failed(&action) click to toggle source

Declare a callback fired if DNS resolution failed

    # File lib/cool.io/dsl.rb, line 102
    def on_resolve_failed(&action)
      @klass.send :define_method, :on_resolve_failed, &action
    end

on_write_complete(&action) click to toggle source

Declare the on_write_complete callback

    # File lib/cool.io/dsl.rb, line 117
    def on_write_complete(&action)
      @klass.send :define_method, :on_write_complete, &action
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.