codesamplex

サンプル

Demonstrate that T::Struct silently ignores unknown attributes at runtime

sha256:2851081928106c445173fdcf82af94358ca1925ee488774a2d51188aa81a9c83

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Demonstrate that T::Struct silently ignores unknown attributes at runtime HOW
パッケージ
sorbet-runtime 0.6.13427
環境
ruby
作成日
2026-08-16T17:12:48Z

よくある思い込み

Initializing a T::Struct with an undeclared attribute is silently ignored at runtime

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート