Sha256: 9aa8e5c86a0df35465151119366b2250f15bf7f6a9bfc37ee4609008ffde9a88

Contents?: true

Size: 1.11 KB

Versions: 14

Compression:

Stored size: 1.11 KB

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.extend(Extensions::AllowedWriterMethods)
      descendant.class_eval { include Methods }
      descendant.class_eval { include InstanceMethods }
      descendant.class_eval { include InstanceMethods::Constructor }
      descendant.class_eval { include InstanceMethods::MassAssignment }
    end
    private_class_method :included

    module Methods

      # 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.attribute_set
      end

    end # Methods

  end # module ClassInclusions
end # module Virtus

Version data entries

14 entries across 12 versions & 3 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/virtus-1.0.5/lib/virtus/class_inclusions.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/virtus-1.0.5/lib/virtus/class_inclusions.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/lib/virtus/class_inclusions.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/lib/virtus/class_inclusions.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/lib/virtus/class_inclusions.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/virtus-1.0.5/lib/virtus/class_inclusions.rb
virtus-1.0.5 lib/virtus/class_inclusions.rb
virtus-1.0.4 lib/virtus/class_inclusions.rb
virtus-1.0.3 lib/virtus/class_inclusions.rb
virtus-1.0.2 lib/virtus/class_inclusions.rb
virtus-1.0.1 lib/virtus/class_inclusions.rb
virtus-1.0.0 lib/virtus/class_inclusions.rb
virtus-1.0.0.rc2 lib/virtus/class_inclusions.rb
virtus-1.0.0.rc1 lib/virtus/class_inclusions.rb