Sha256: 1f256ba3d7201531679888f4f043038ada0afca68c3fe76973273defba7746b2

Contents?: true

Size: 821 Bytes

Versions: 2

Compression:

Stored size: 821 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.class_eval { include InstanceMethods }
    end
    private_class_method :included

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

  private

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

  end # module ClassInclusions
end # module Virtus

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
motion_virtus-1.0.0.beta0.1 lib/project/class_inclusions.rb
motion_virtus-1.0.0.beta0 lib/project/class_inclusions.rb