Class: Sass::Tree::Node

Class | Sass::Tree::Node
In: | lib/sass/tree/node.rb
Parent: | Object

### Methods

<< new to_s

### Attributes

children | [RW] |
filename | [RW] |
line | [RW] |

### Public Class methods

new(style)

[Source]

        # File lib/sass/tree/node.rb, line 8
     8:       def initialize(style)
     9:         @style = style
    10:         @children = []
    11:       end

### Public Instance methods

<<(child)

[Source]

        # File lib/sass/tree/node.rb, line 13
    13:       def <<(child)
    14:         if msg = invalid_child?(child)
    15:           raise Sass::SyntaxError.new(msg, child.line)
    16:         end
    17:         @children << child
    18:       end

to_s()

[Source]

        # File lib/sass/tree/node.rb, line 20
    20:       def to_s
    21:         result = String.new
    22:         children.each do |child|
    23:           if child.is_a? AttrNode
    24:             raise SyntaxError.new('Attributes aren\'t allowed at the root of a document.', child.line)
    25:           else
    26:             result << "#{child.to_s(1)}" + (@style == :compressed ? '' : "\n")
    27:           end
    28:         end
    29:         @style == :compressed ? result+"\n" : result[0...-1]
    30:       end

[Validate]