Class: Irc::TopicMessage

Inherits:
BasicUserMessage show all
Defined in:
lib/rbot/message.rb

Instance Attribute Summary collapse

Attributes inherited from BasicUserMessage

#bot, #ignored, #in_thread, #logmessage, #message, #plainmessage, #replied, #server, #source, #target, #time

Instance Method Summary collapse

Methods inherited from BasicUserMessage

#address?, #botuser, #identified?, #parse_channel_list, #recurse_depth, #recurse_depth=, #sourceaddress, #sourcenick, strip_formatting, strip_initial_formatting, stripcolour

Constructor Details

#initialize(bot, server, source, channel, topic = ChannelTopic.new) ⇒ TopicMessage

Returns a new instance of TopicMessage.



586
587
588
589
590
591
592
# File 'lib/rbot/message.rb', line 586

def initialize(bot, server, source, channel, topic=ChannelTopic.new)
  super(bot, server, source, channel, topic.text)
  @topic = topic
  @timestamp = topic.set_on
  @channel = channel
  @info_or_set = nil
end

Instance Attribute Details

#channelObject (readonly)

topic set on channel



582
583
584
# File 'lib/rbot/message.rb', line 582

def channel
  @channel
end

#info_or_setObject

:info if topic info, :set if topic set



585
586
587
# File 'lib/rbot/message.rb', line 585

def info_or_set
  @info_or_set
end

#timestampObject (readonly)

topic set at (unixtime)



580
581
582
# File 'lib/rbot/message.rb', line 580

def timestamp
  @timestamp
end

#topicObject (readonly)

channel topic



578
579
580
# File 'lib/rbot/message.rb', line 578

def topic
  @topic
end

Instance Method Details

#inspectObject



594
595
596
597
598
# File 'lib/rbot/message.rb', line 594

def inspect
  fields = ' topic=' << topic
  fields << ' (set on ' << timestamp << ')'
  super(fields)
end