lib/db_mod/statements/configuration/as.rb in db_mod-0.0.5 vs lib/db_mod/statements/configuration/as.rb in db_mod-0.0.6
- old
+ new
@@ -22,13 +22,15 @@
csv: As::Csv,
json: As::Json
}
# Extend the given method definition with additional
- # result coercion.
+ # result coercion, if specified using {MethodConfiguration#as}.
#
# @param definition [Proc] base method definition
# @param config [MethodConfiguration] method configuration
+ # @return [Proc] wrapped method definition, or the original
+ # definition if no coercion has been specified
def self.extend(definition, config)
type = config[:as]
return definition if type.nil?
Configuration.attach_result_processor definition, COERCERS[type]