Class: ActiveAttr::Typecasting::StringTypecaster
- Inherits:
-
Object
- Object
- ActiveAttr::Typecasting::StringTypecaster
- Defined in:
- lib/active_attr/typecasting/string_typecaster.rb
Overview
Typecasts an Object to a String
Instance Method Summary collapse
-
#call(value) ⇒ String?
Typecasts an object to a String.
Instance Method Details
#call(value) ⇒ String?
Typecasts an object to a String
Attempts to convert using #to_s.
22 23 24 |
# File 'lib/active_attr/typecasting/string_typecaster.rb', line 22 def call(value) value.to_s if value.respond_to? :to_s end |