module Peggy::OneChild

An element with a single child element.

Attributes

<<[RW]

The single child

child[RW]

The single child

Public Instance Methods

to_s() click to toggle source

Convert to String.

# File lib/parse/builder.rb, line 43
def to_s
  wrap
end
wrap() click to toggle source

Enclose child in parentheses if appropriate.

# File lib/parse/builder.rb, line 48
def wrap
  result = child.respond_to?(:each) ? "(#{child})" : child.to_s
end