Module: DataMapper::Constraints::Adapters::Extension

### Home Classes Methods

### In Files

- lib/data_mapper/constraints/adapters/extension.rb

### Methods

- #include_constraint_api

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::Constraints
- DataMapper::Constraints::Adapters
- DataMapper::Constraints::Adapters::AbstractAdapter
- DataMapper::Constraints::Adapters::DataObjectsAdapter
- DataMapper::Constraints::Adapters::DataObjectsAdapter::SQL
- DataMapper::Constraints::Adapters::Extension
- DataMapper::Constraints::Adapters::MysqlAdapter
- DataMapper::Constraints::Adapters::MysqlAdapter::SQL
- DataMapper::Constraints::Adapters::OracleAdapter
- DataMapper::Constraints::Adapters::PostgresAdapter
- DataMapper::Constraints::Adapters::SqliteAdapter
- DataMapper::Constraints::Adapters::SqlserverAdapter
- DataMapper::Constraints::Migrations
- DataMapper::Constraints::Migrations::Model
- DataMapper::Constraints::Migrations::Relationship
- DataMapper::Constraints::Migrations::Relationship::ManyToOne
- DataMapper::Constraints::Migrations::SingletonMethods
- DataMapper::Constraints::Relationship
- DataMapper::Constraints::Relationship::ManyToMany
- DataMapper::Constraints::Relationship::OneToMany
- DataMapper::Constraints::Resource

No matching classes.

# DataMapper::Constraints::Adapters::Extension

### Public Instance Methods

include_constraint_api(const_name) click to toggle source

Include the corresponding Constraints module into a adapter class

@param [Symbol] const_name

    demodulized name of the adapter class to include corresponding
    constraints module into

TODO: come up with a better way to include modules into all currently loaded and subsequently loaded Adapters

@api private

    # File lib/data_mapper/constraints/adapters/extension.rb, line 15
    def include_constraint_api(const_name)
      require constraint_extensions(const_name)

      if Constraints::Adapters.const_defined?(const_name)
        adapter = const_get(const_name)
        constraint_module = Constraints::Adapters.const_get(const_name)
        adapter.class_eval { include constraint_module }
      end
    rescue LoadError
      # Silently ignore the fact that no adapter extensions could be required
      # This means that the adapter in use doesn't support constraints
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.