Class: Goliath::Rack::Types::Symbol

Inherits:
Base
  • Object
show all
Defined in:
lib/goliath/rack/types/symbol.rb

Constant Summary collapse

ERROR_MESSAGE =
"%s can't convert to Symbol"

Instance Method Summary collapse

Methods inherited from Base

#coerce, #initialize

Methods included from Validator

safely, validation_error

Constructor Details

This class inherits a constructor from Goliath::Rack::Types::Base

Instance Method Details

#_coerce(val) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/goliath/rack/types/symbol.rb', line 6

def _coerce(val)
  begin
    val.to_sym
  rescue
    raise ERROR_MESSAGE % val
  end
end