Permalink
Browse files

Minor clean up in Attribute

  • Loading branch information...
1 parent 4c2be79 commit c2a47706dc4aba8be5d6baaf89178f7436b4838e @solnic committed Mar 9, 2013
Showing with 13 additions and 13 deletions.
  1. +13 −13 lib/virtus/attribute.rb
View
@@ -171,25 +171,16 @@ def writer
accessor.writer
end
- # Is the given value coerced into the target type for this attribute?
- #
- # @return [Boolean]
- #
- # @api private
- def value_coerced?(value)
- coercer.coerced?(value)
- end
-
# Define reader and writer methods for an Attribute
#
- # @param [Module] mod
+ # @param [AttributeSet] mod
#
# @return [self]
#
# @api private
- def define_accessor_methods(mod)
- reader.define_method(accessor, mod)
- writer.define_method(accessor, mod)
+ def define_accessor_methods(attribute_set)
+ reader.define_method(accessor, attribute_set)
+ writer.define_method(accessor, attribute_set)
self
end
@@ -211,6 +202,15 @@ def public_writer?
accessor.public_writer?
end
+ # Returns if the given value is coerced into the target type
+ #
+ # @return [Boolean]
+ #
+ # @api private
+ def value_coerced?(value)
+ coercer.coerced?(value)
+ end
+
private
# Return coercer for this attribute

0 comments on commit c2a4770

Please sign in to comment.