#!/usr/bin/env ruby class LineDeterminator def initialize (line) @strippedLine = line.strip end def isComment @strippedLine[0...2] == "//" or @strippedLine[0...3] == "///" end def isVar @strippedLine[0...3] == "var" end def isLet @strippedLine[0...3] == "let" end def isClass @strippedLine[0...5] == "class" end def isFunction @strippedLine[0...4] == "func" end def lineType if isComment return CommentLineType.new(@strippedLine) end if isVar return VariableLineType.new(@strippedLine) end if isLet return ConstantLineType.new(@strippedLine) end if isClass return ClassLineType.new(@strippedLine) end return LineType.new(@strippedLine) end end