1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00
haml--haml/lib/sass/tree/node.rb
nex3 edb938e324 Sass style-setting.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@348 7063305b-7217-0410-af8c-cdc13e5119b9
2007-02-06 01:58:23 +00:00

29 lines
576 B
Ruby

module Sass
module Tree
class Node
attr_accessor :children
attr_accessor :line
def initialize(style)
@style = style
@children = []
end
def <<(child)
@children << child
end
def to_s
result = String.new
children.each do |child|
if child.is_a? AttrNode
raise SyntaxError.new('Attributes aren\'t allowed at the root of a document.', child.line)
end
result += "#{child.to_s}\n"
end
result[0...-1]
end
end
end
end