Class: SSCBot::ChatLogFile

Inherits:
SSCFile
  • Object
show all
Includes:
SSCBot::ChatLog::MessageParsable
Defined in:
lib/ssc.bot/chat_log_file.rb

Overview

Author:

  • Jonathan Bradley Whited

Since:

  • 0.1.0

Constant Summary

Constants included from SSCBot::ChatLog::MessageParsable

SSCBot::ChatLog::MessageParsable::MAX_NAMELEN

Constants inherited from SSCFile

SSCFile::DEFAULT_BUFFER_LEN, SSCFile::DEFAULT_ENCODING, SSCFile::DEFAULT_MODE, SSCFile::DEFAULT_SEPARATOR

Instance Attribute Summary

Attributes included from SSCBot::ChatLog::MessageParsable

#parser

Instance Method Summary collapse

Methods inherited from SSCFile

clear_content, #read_uline, #seek_to_end, soft_touch

Constructor Details

#initialize(filename, mode = DEFAULT_MODE, parser: ChatLog::MessageParser.new, **file_kargs) ⇒ ChatLogFile

Returns a new instance of ChatLogFile.

Since:

  • 0.1.0



27
28
29
30
31
# File 'lib/ssc.bot/chat_log_file.rb', line 27

def initialize(filename,mode=DEFAULT_MODE,parser: ChatLog::MessageParser.new,**file_kargs)
  super(filename,mode,**file_kargs)

  @parser = parser
end

Instance Method Details

#parse_lineObject

Since:

  • 0.1.0



33
34
35
36
37
# File 'lib/ssc.bot/chat_log_file.rb', line 33

def parse_line
  line = read_uline

  return line.nil? ? nil : parse(line)
end