for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
module Koine
module Attributes
module Adapter
class String < Base
def empty_to_nil
@empty_to_nil = true
self
end
def trim_empty_spaces
@trim_empty_spaces = true
def coerce(value)
secure do
value = String(value)
value = value.strip if @trim_empty_spaces
return nil if value.empty? && @empty_to_nil
value