Class: Phlex::SGML

Inherits:
Object
  • Object
show all
Defined in:
lib/phlex/opal_compat.rb

Direct Known Subclasses

HTML, SVG

Defined Under Namespace

Modules: Attributes Classes: State

Instance Method Summary collapse

Instance Method Details

#call(buffer = Phlex::OpalBuffer.new, context: {}, fragments: nil) ⇒ Object



208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/phlex/opal_compat.rb', line 208

def call(buffer = Phlex::OpalBuffer.new, context: {}, fragments: nil, &)
  buffer = Phlex::OpalBuffer.new(buffer) if buffer.is_a?(String)
  state = Phlex::SGML::State.new(
    user_context: context,
    output_buffer: buffer,
    fragments: fragments&.to_set
  )

  internal_call(parent: nil, state:, &)

  state.output_buffer << state.buffer
end