Sha256: 3848c43d269db8628d76648ae260924750cd4a36c2d64c922361cf80c8343478

Contents?: true

Size: 614 Bytes

Versions: 3

Compression:

Stored size: 614 Bytes

Contents

require 'rom/boot/schema_dsl'
require 'rom/boot/mapper_dsl'
require 'rom/boot/command_dsl'

module ROM
  class Boot

    class DSL
      attr_reader :env

      def initialize(env)
        @env = env
        @schema = {}
      end

      def schema(&block)
        dsl = SchemaDSL.new(env, @schema)
        dsl.instance_exec(&block)
        dsl.call
      end

      def mappers(&block)
        dsl = MapperDSL.new
        dsl.instance_exec(&block)
        dsl.call
      end

      def commands(&block)
        dsl = CommandDSL.new
        dsl.instance_exec(&block)
        dsl.call
      end

    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rom-0.4.2 lib/rom/boot/dsl.rb
rom-0.4.1 lib/rom/boot/dsl.rb
rom-0.4.0 lib/rom/boot/dsl.rb