Class: EDL::CommentMatcher
Overview
EDL clip comment matcher, a generic one
Instance Method Summary collapse
- #apply(stack, line) ⇒ Object
-
#initialize ⇒ CommentMatcher
constructor
A new instance of CommentMatcher.
Methods inherited from Matcher
Constructor Details
#initialize ⇒ CommentMatcher
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
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 |