Sha256: 825d9665f112c91aef957c48f83b30516e5fb69777be393b4ceb0511d9f42b12

Contents?: true

Size: 465 Bytes

Versions: 14

Compression:

Stored size: 465 Bytes

Contents

# frozen_string_literal: true

module ROM
  module SQL
    module Migration
      # @api private
      class Recorder
        attr_reader :operations

        def initialize(&block)
          @operations = []

          instance_exec(&block) if block
        end

        def method_missing(m, *args, &block)
          nested = block ? Recorder.new(&block).operations : EMPTY_ARRAY
          @operations << [m, args, nested]
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rom-sql-3.6.5 lib/rom/sql/migration/recorder.rb
rom-sql-3.6.4 lib/rom/sql/migration/recorder.rb
rom-sql-3.6.3 lib/rom/sql/migration/recorder.rb
rom-sql-3.6.2 lib/rom/sql/migration/recorder.rb
rom-sql-3.6.1 lib/rom/sql/migration/recorder.rb
rom-sql-3.6.0 lib/rom/sql/migration/recorder.rb
rom-sql-4.0.0.alpha1 lib/rom/sql/migration/recorder.rb
rom-sql-3.5.0 lib/rom/sql/migration/recorder.rb
rom-sql-3.4.0 lib/rom/sql/migration/recorder.rb
rom-sql-3.3.3 lib/rom/sql/migration/recorder.rb
rom-sql-3.3.2 lib/rom/sql/migration/recorder.rb
rom-sql-3.3.1 lib/rom/sql/migration/recorder.rb
rom-sql-3.3.0 lib/rom/sql/migration/recorder.rb
rom-sql-3.2.0 lib/rom/sql/migration/recorder.rb