class TPPlus::Nodes::CommentNode

Public Class Methods

new(text) click to toggle source
# File lib/tp_plus/nodes/comment_node.rb, line 4
def initialize(text)
  @text = text[1,text.length]
end

Public Instance Methods

eval(context) click to toggle source
# File lib/tp_plus/nodes/comment_node.rb, line 8
def eval(context)
  s = ""
  width = 29
  @text.scan(/\S.{0,#{width}}\S(?=\s|$)|\S+/).each do |piece|
    s += "! #{piece} ;\n"
  end
  s[0,s.length-3]
end