Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add missing @example to String.to_class...I always forget about that :P

  • Loading branch information...
commit 7360a449560d772cf53c801fa05b10614d0575d9 1 parent a00175a
@solnic authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/virtus/coercion/string.rb
View
4 lib/virtus/coercion/string.rb
@@ -13,12 +13,16 @@ class String < Object
# Coerce give value to a constant
#
+ # @example
+ # Virtus::Coercion::String.to_class('String') # => String
+ #
# @param [String] value
#
# @return [Object]
#
# @api public
def self.to_class(value)
+ # TODO: add support for namespaced classes like 'Virtus::Attribute::String'
::Object.const_get(value)
end
Please sign in to comment.
Something went wrong with that request. Please try again.