Sha256: 06015f7109a3e5f4da6be0a4d4b86946fb76ef4e823a06a7c3c0de9a5aef0069

Contents?: true

Size: 814 Bytes

Versions: 5

Compression:

Stored size: 814 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

  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

5 entries across 5 versions & 2 rubygems

Version Path
virtus-0.5.5 lib/virtus/class_inclusions.rb
virtus-0.5.4 lib/virtus/class_inclusions.rb
virtus-0.5.3 lib/virtus/class_inclusions.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/lib/virtus/class_inclusions.rb
virtus-0.5.2 lib/virtus/class_inclusions.rb