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.
160 161 162 |
# File 'lib/edl.rb', line 160 def initialize super(/^\*(.+)/) end |
Instance Method Details
#apply(stack, line) ⇒ Object
164 165 166 167 168 |
# File 'lib/edl.rb', line 164 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 |