Class: UnicodePlugin

Inherits:
CoreBotModule
  • Object
show all
Defined in:
/home/apoc/projects/ruby/rbot/lib/rbot/core/unicode.rb

Overview

– vim:sw=2:et ++

:title: Unicode plugin To set the encoding of strings coming from the irc server.

Defined Under Namespace

Classes: UnicodeFilter

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (UnicodePlugin) initialize(*a)

Returns a new instance of UnicodePlugin



34
35
36
37
# File '/home/apoc/projects/ruby/rbot/lib/rbot/core/unicode.rb', line 34

def initialize(*a)
  super
  self.class.reconfigure_filter(@bot)
end

Class Method Details

+ (Object) reconfigure_filter(bot)



45
46
47
48
49
50
51
52
53
# File '/home/apoc/projects/ruby/rbot/lib/rbot/core/unicode.rb', line 45

def UnicodePlugin.reconfigure_filter(bot)
  debug "configuring encodings"
  charset = bot.config['encoding.charset']
  if bot.config['encoding.enable']
    bot.socket.filter = UnicodeFilter.new charset
  else
    bot.socket.filter = nil
  end
end

Instance Method Details

- (Object) cleanup



39
40
41
42
43
# File '/home/apoc/projects/ruby/rbot/lib/rbot/core/unicode.rb', line 39

def cleanup
  debug "cleaning up encodings"
  @bot.socket.filter = nil
  super
end