Class: Lydown::Parsing::StreamIndex

Inherits:
Root
  • Object
show all
Defined in:
lib/lydown/parsing/nodes.rb

Instance Method Summary collapse

Methods inherited from Root

#initialize

Methods included from RootMethods

#_to_stream, #add_event, #each_child, #event_hash

Constructor Details

This class inherits a constructor from Lydown::Parsing::Root

Instance Method Details

#to_stream(o, opts) ⇒ Object



335
336
337
338
339
340
341
# File 'lib/lydown/parsing/nodes.rb', line 335

def to_stream(o, opts)
  idx = (text_value =~ /\(([\d]+)\)/) && $1.to_i
  if idx.nil?
    raise LydownError, "Invalid stream index (#{text_value.inspect})"
  end
  o[:stream_index] = idx
end