Sha256: d007ce66200c105aab92b2adae63b54ba2092768fbe7656f770a24db6904d20f

Contents?: true

Size: 434 Bytes

Versions: 12

Compression:

Stored size: 434 Bytes

Contents

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

12 entries across 12 versions & 1 rubygems

Version Path
rom-sql-3.1.0 lib/rom/sql/migration/recorder.rb
rom-sql-3.0.1 lib/rom/sql/migration/recorder.rb
rom-sql-3.0.0 lib/rom/sql/migration/recorder.rb
rom-sql-2.5.0 lib/rom/sql/migration/recorder.rb
rom-sql-2.4.0 lib/rom/sql/migration/recorder.rb
rom-sql-2.3.0 lib/rom/sql/migration/recorder.rb
rom-sql-2.2.1 lib/rom/sql/migration/recorder.rb
rom-sql-2.2.0 lib/rom/sql/migration/recorder.rb
rom-sql-2.1.0 lib/rom/sql/migration/recorder.rb
rom-sql-2.0.0 lib/rom/sql/migration/recorder.rb
rom-sql-2.0.0.rc1 lib/rom/sql/migration/recorder.rb
rom-sql-2.0.0.beta3 lib/rom/sql/migration/recorder.rb