Module: IIRC::Ambient

Includes:
Verbs
Included in:
Batteries
Defined in:
lib/iirc/modules/ambient.rb

Overview

Ambient lets you access the current event without having to pass it around.

A thread-local variable is set by Events when an event comes in.

Overloads of Verbs#say, Verbs#act, Verbs#mode, Verbs#join etc. make their first argument optional.

This module pulls in both Events and Verbs.

Examples:

say (with Ambient)

def on_privmsg
  say "Hello!"
end

say (without)

def on_privmsg(evt)
  say reply_target(evt), "Hello!"
end

mode (with Ambient)

def on_join(evt)
  mode "+v #{evt.nick}"
end

Defined Under Namespace

Modules: Events, LabeledRequests, ReplyTarget, Verbs

Method Summary

Methods included from Verbs

#act, #cycle, #join, #mode, #msg, #part

Methods included from ReplyTarget

#reply_target

Methods included from Events

#ambient_event, #ambient_sender, #ambient_target, #configure_ambient_events, #set_ambient_event, #with_ambient_event