Skip to content

Commit

Permalink
Minor clean up in Attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
solnic committed Mar 9, 2013
1 parent 4c2be79 commit c2a4770
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/virtus/attribute.rb
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit c2a4770

Please sign in to comment.