Class: Hexp::Node::Normalize

Inherits:
Object
  • Object
show all
Defined in:
lib/hexp/node/normalize.rb

Overview

Normalize a node

Instance Method Summary (collapse)

Constructor Details

- (Normalize) initialize(node)

Set a node to be normalized

Examples:

Hexp::Node::Normalize.new([:p, {class:'foo'}])

Parameters:

  • node (Array)

    A non-strict hexp



15
16
17
# File 'lib/hexp/node/normalize.rb', line 15

def initialize(node)
  @raw = node
end

Instance Method Details

- (Array) call

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Normalize to strict hexp nodes, cfr SPEC.md for details

Returns:

  • (Array)

    strict hexp node



25
26
27
# File 'lib/hexp/node/normalize.rb', line 25

def call
  [@raw.first, normalized_attributes, normalized_children]
end