Registry / utility / sorbet-coerce

sorbet-coerce

JSON →
library0.7.0rbrubygemsunverified

A type coercion library that works with Sorbet's static type checker and type definitions, raising an error if coercion fails.

gem install sorbet-coerce
INSTALL
IMPORT
SIG · SORBET-COERCE
S
sorbet-coerce
utilityrubyv0.7.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SorbetCoerce
require 'sorbet-coerce'

Coerce a string to an integer using Sorbet type definitions.

require 'sorbet-coerce' coercer = SorbetCoerce::Coercer.new result = coercer.coerce(Integer, '42')
Debug
Known issues
gotchaRequires Sorbet runtime type definitions to be present.
fix
Ensure your codebase has Sorbet type annotations and the sorbet-runtime gem is loaded.
affects: >= 0.7.0
Upgrade
Version history
0.7.0latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
sorbet-coerce — gem install sorbet-coerce · libregistry