Class: Coercer::String

Inherits:
Object
  • Object
show all
Defined in:
lib/attribrutal/coercion.rb

Class Method Summary collapse

Class Method Details

.coerce(arg, default = nil) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/attribrutal/coercion.rb', line 24

def self.coerce(arg, default = nil)
  if arg.nil?
    default
  else
    String(arg)
  end
end