Class: Sevgi::Graphics::Content::Encoded

Inherits:
Content
  • Object
show all
Defined in:
lib/sevgi/graphics/auxiliary/content.rb

Overview

XML text-encoded content backed by an immutable payload snapshot. Mutable leaf objects are stringified during construction, before XML escaping.

See Also:

Instance Method Summary collapse

Instance Method Details

#render(renderer, depth) ⇒ Object

Renders encoded text content.

Parameters:

  • renderer (#append)

    rendering output collaborator

  • depth (Integer)

    current render depth

Returns:

  • (Object)

    ignored by the rendering engine



280
# File 'lib/sevgi/graphics/auxiliary/content.rb', line 280

def render(renderer, depth) = renderer.append(depth + 1, to_s)

#to_sString

Returns XML text-encoded content.

Returns:

  • (String)


274
# File 'lib/sevgi/graphics/auxiliary/content.rb', line 274

def to_s = XML.text(payload).encode(xml: :text)