Sha256: a1d063c9d7d66015c8c0fe5dea3f38e4aca8e6a3f84bb59673e85204d54c0d92

Contents?: true

Size: 807 Bytes

Versions: 2

Compression:

Stored size: 807 Bytes

Contents

module Virtus

  # Class-level extensions
  module ClassInclusions

    # Extends a descendant with class and instance methods
    #
    # @param [Class] descendant
    #
    # @return [undefined]
    #
    # @api private
    def self.included(descendant)
      super
      descendant.extend(ClassMethods)
      descendant.send(:include, InstanceMethods)
    end
    private_class_method :included

  private

    # Return class' attribute set
    #
    # @return [Virtus::AttributeSet]
    #
    # @api private
    def attribute_set
      self.class.attribute_set
    end

    # Return a list of allowed writer method names
    #
    # @return [Set]
    #
    # @api private
    def allowed_writer_methods
      self.class.allowed_writer_methods
    end

  end # module ClassInclusions
end # module Virtus

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
virtus-0.5.1 lib/virtus/class_inclusions.rb
virtus-0.5.0 lib/virtus/class_inclusions.rb