Method: Highway::Steps::Types::Url#typecheck
- Defined in:
- lib/highway/steps/types/url.rb
#typecheck(value) ⇒ URI?
Typecheck and coerce a value if possible.
This method returns a typechecked and coerced value or nil if value has invalid type and can’t be coerced.
25 26 27 28 29 |
# File 'lib/highway/steps/types/url.rb', line 25 def typecheck(value) typechecked = super(value) parsed = URI.parse(typechecked) rescue nil parsed if parsed && parsed.kind_of?(URI::HTTP) end |