Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change name of private method for allowed writers

* Add YARD docs for the private methods
  • Loading branch information...
commit b32d6eb8a60b7d12c239a3e48d43433e82578871 1 parent c700c23
@dkubb dkubb authored
View
8 lib/virtus/class_methods.rb
@@ -111,9 +111,13 @@ def virtus_add_attribute(attribute)
descendants.each { |descendant| descendant.attribute_set.reset }
end
+ # The list of allowed public methods
+ #
+ # @return [Array<String>]
+ #
# @api private
- def public_method_list
- public_instance_methods
+ def allowed_methods
+ public_instance_methods.map(&:to_s)
end
end # module ClassMethods
View
3  lib/virtus/extensions.rb
@@ -63,8 +63,7 @@ def attribute(*args)
def allowed_writer_methods
@allowed_writer_methods ||=
begin
- allowed_writer_methods = public_method_list.map(&:to_s)
- allowed_writer_methods = allowed_writer_methods.grep(WRITER_METHOD_REGEXP).to_set
+ allowed_writer_methods = allowed_methods.grep(WRITER_METHOD_REGEXP).to_set
allowed_writer_methods -= INVALID_WRITER_METHODS
allowed_writer_methods.freeze
end
View
8 lib/virtus/instance_methods.rb
@@ -181,9 +181,13 @@ def set_attribute(name, value)
__send__("#{name}=", value)
end
+ # The list of allowed public methods
+ #
+ # @return [Array<String>]
+ #
# @api private
- def public_method_list
- public_methods
+ def allowed_methods
+ public_methods.map(&:to_s)
end
end # module InstanceMethods
Please sign in to comment.
Something went wrong with that request. Please try again.