Sha256: 933f95e6a3bae68dced90f517910196a5900574dbfad2bc20ad70c819b2220e1
Contents?: true
Size: 511 Bytes
Versions: 33
Compression:
Stored size: 511 Bytes
Contents
# typed: ignore require 'sorbet-runtime' if !$PROGRAM_NAME.include?('sorbet') module TypeAssertImpl def self.included(klass) klass.define_singleton_method(:[]) do |type| return Class.new do include ITypeAssert define_method(:to_s) { "TA[#{type.to_s}]" } define_method(:assert) do |val| T.let(val, type) end define_method(:get_type) { type } end end end end class TA include TypeAssertImpl end end
Version data entries
33 entries across 33 versions & 1 rubygems