Sha256: e07e8e88a172a1076fcc4c261a0f3d7e3e2d165e9b514df183cc0072da2527f1

Contents?: true

Size: 641 Bytes

Versions: 5

Compression:

Stored size: 641 Bytes

Contents

module Vedeu

  # Repositories contain registerables, this module provides convenience methods
  # for them.
  module Registerable

    # These class methods are mixed into the repository.
    module ClassMethods

      # @param klass [Class]
      # @return [Symbol]
      def null(klass)
        define_method(:null_model) { klass }
      end

    end # ClassMethods

    # When this module is included in a class, provide ClassMethods as class
    # methods for the class.
    #
    # @param klass [Class]
    # @return [void]
    def self.included(klass)
      klass.send :extend, ClassMethods
    end

  end # Registerable

end # Vedeu

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vedeu-0.4.23 lib/vedeu/repositories/registerable.rb
vedeu-0.4.22 lib/vedeu/repositories/registerable.rb
vedeu-0.4.21 lib/vedeu/repositories/registerable.rb
vedeu-0.4.20 lib/vedeu/repositories/registerable.rb
vedeu-0.4.19 lib/vedeu/repositories/registerable.rb