summaryrefslogtreecommitdiff
path: root/lib/mpeg/sequence.rb
blob: 9172370f4049b9cb122d7640ef0a679a28ad279a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Mpeg
  class Sequence < Base
    def initialize(left, right)
      @left = left
      @right = right
    end

    def call(input)
      input.transaction do |x|
        result = @left.call(input) && @right.call(input)
        x.commit! if result
        result
      end
    end
  end
end