Class: EDL::CommentMatcher

Inherits:
Matcher
  • Object
show all
Defined in:
lib/edl.rb

Overview

EDL clip comment matcher, a generic one

Instance Method Summary collapse

Methods inherited from Matcher

#matches?

Constructor Details

#initializeCommentMatcher

Returns a new instance of CommentMatcher.



156
157
158
# File 'lib/edl.rb', line 156

def initialize
  super(/\*(.+)/)
end

Instance Method Details

#apply(stack, line) ⇒ Object

Raises:



160
161
162
163
164
# File 'lib/edl.rb', line 160

def apply(stack, line)
  raise ApplyError.new("No event to attach a comment to", line) if stack.empty?
  # TODO: we should really remove "* " prefixes from comments
  stack[-1].comments.push("* %s" % line.scan(@regexp).flatten.pop.strip)
end