class Irc::Channel::Topic

A Topic represents the topic of a channel. It consists of the topic itself, who set it and when

Attributes

set_by[RW]
set_on[RW]
text[RW]
to_s[RW]

Public Class Methods

new(text="", set_by="", set_on=Time.new) click to toggle source

Create a new Topic setting the text, the creator and the creation time

# File lib/rbot/irc.rb, line 1286
def initialize(text="", set_by="", set_on=Time.new)
  @text = text
  @set_by = set_by.to_irc_netmask
  @set_on = set_on
end

Public Instance Methods

replace(topic) click to toggle source

Replace a Topic with another one

# File lib/rbot/irc.rb, line 1294
def replace(topic)
  raise TypeError, "#{topic.inspect} is not of class #{self.class}" unless topic.kind_of?(self.class)
  @text = topic.text.dup
  @set_by = topic.set_by.dup
  @set_on = topic.set_on.dup
end
to_irc_channel_topic() click to toggle source

Returns self

# File lib/rbot/irc.rb, line 1303
def to_irc_channel_topic
  self
end