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
15:         def include_constraint_api(const_name)
16:           require constraint_extensions(const_name)
17: 
18:           if Constraints::Adapters.const_defined?(const_name)
19:             adapter = const_get(const_name)
20:             constraint_module = Constraints::Adapters.const_get(const_name)
21:             adapter.class_eval { include constraint_module }
22:           end
23:         rescue LoadError
24:           # Silently ignore the fact that no adapter extensions could be required
25:           # This means that the adapter in use doesn't support constraints
26:         end

Private Instance Methods

const_added(const_name) click to toggle source

@api private

    # File lib/data_mapper/constraints/adapters/extension.rb, line 38
38:         def const_added(const_name)
39:           include_constraint_api(const_name)
40:           super
41:         end
constraint_extensions(const_name) click to toggle source

@api private

    # File lib/data_mapper/constraints/adapters/extension.rb, line 31
31:         def constraint_extensions(const_name)
32:           name = adapter_name(const_name)
33:           name = 'do' if name == 'dataobjects'
34:           "data_mapper/constraints/adapters/#{name}_adapter"
35:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.