module Virtus::Extensions::AllowedWriterMethods

Constants

INVALID_WRITER_METHODS
WRITER_METHOD_REGEXP

Public Instance Methods

allowed_writer_methods() click to toggle source

The list of writer methods that can be mass-assigned to in attributes=

@return [Set]

@api private

# File lib/virtus/extensions.rb, line 100
def allowed_writer_methods
  @allowed_writer_methods ||=
    begin
      allowed_writer_methods  = allowed_methods.grep(WRITER_METHOD_REGEXP).to_set
      allowed_writer_methods -= INVALID_WRITER_METHODS
      allowed_writer_methods.freeze
    end
end