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, #prefixed?, #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.



663
664
665
666
667
668
669
# File 'lib/rbot/message.rb', line 663

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



659
660
661
# File 'lib/rbot/message.rb', line 659

def channel
  @channel
end

#info_or_setObject

:info if topic info, :set if topic set



662
663
664
# File 'lib/rbot/message.rb', line 662

def info_or_set
  @info_or_set
end

#timestampObject (readonly)

topic set at (unixtime)



657
658
659
# File 'lib/rbot/message.rb', line 657

def timestamp
  @timestamp
end

#topicObject (readonly)

channel topic



655
656
657
# File 'lib/rbot/message.rb', line 655

def topic
  @topic
end

Instance Method Details

#inspectObject



671
672
673
674
675
# File 'lib/rbot/message.rb', line 671

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