sorbet-runtime 0.5.11422 → 0.5.11429

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a675bfbf51b32916be960aadcc1411329f21729d5ceb2218509da82d20387ddd
4
- data.tar.gz: a39ec7df0cf067c2c31d22f557caea810c37c4985c1437a28e03b5db72036c0b
3
+ metadata.gz: 723285bad30a7ed267bc7e16950c70a1580b00ad6f17d2d47aaa012f23f70d59
4
+ data.tar.gz: 7ed80dd74c08e6838bde1c135d5693734670728459887b30f5a90479c1e529a9
5
5
  SHA512:
6
- metadata.gz: dab2fb9c543e4eb0c652446435ad9c7a41d3850a3a2eefda6fc25a64181cbbe8a027e7313f37eea42c1bc14771be5bd6ff2799b4589668d43c4d1a3f91840953
7
- data.tar.gz: '09c74373b54c24f90a63106bc726ab4fb66d61dca523bb4323effc9072bf08162135b52deb3ad648b31be156ccd609f907efc30015a5bac3b14f83f5d53bf384'
6
+ metadata.gz: 165564d0a780d944f9405f9263f10651c36a42acef564f494fd2698e48c677edb5025556debcf1272e92388a0dbfab976161b559da9d746bc27554559682c32c
7
+ data.tar.gz: cdbd24f0017f935a6993fff6b6a1d3ed3297cdc5115ef23d7fce93ce708a2c5b5d840f40620b994c2d2e4d48fc66e371943a7baede3112ed69692455df5efeb4
@@ -110,7 +110,7 @@ module T::Props
110
110
  #
111
111
  # @return [void]
112
112
  sig {params(name: Symbol, cls: T.untyped, rules: T.untyped).void}
113
- def prop(name, cls, rules={})
113
+ def prop(name, cls, **rules)
114
114
  cls = T::Utils.coerce(cls) if !cls.is_a?(Module)
115
115
  decorator.prop_defined(name, cls, rules)
116
116
  end
@@ -132,16 +132,16 @@ module T::Props
132
132
  end
133
133
 
134
134
  # Shorthand helper to define a `prop` with `immutable => true`
135
- sig {params(name: Symbol, cls_or_args: T.untyped, args: T::Hash[Symbol, T.untyped]).void}
136
- def const(name, cls_or_args, args={})
135
+ sig {params(name: Symbol, cls_or_args: T.untyped, args: T.untyped).void}
136
+ def const(name, cls_or_args, **args)
137
137
  if (cls_or_args.is_a?(Hash) && cls_or_args.key?(:immutable)) || args.key?(:immutable)
138
138
  Kernel.raise ArgumentError.new("Cannot pass 'immutable' argument when using 'const' keyword to define a prop")
139
139
  end
140
140
 
141
141
  if cls_or_args.is_a?(Hash)
142
- self.prop(name, cls_or_args.merge(immutable: true))
142
+ self.prop(name, **cls_or_args.merge(immutable: true))
143
143
  else
144
- self.prop(name, cls_or_args, args.merge(immutable: true))
144
+ self.prop(name, cls_or_args, **args.merge(immutable: true))
145
145
  end
146
146
  end
147
147
 
data/lib/types/struct.rb CHANGED
@@ -39,7 +39,7 @@ class T::ImmutableStruct < T::InexactStruct
39
39
 
40
40
  # Matches the signature in Props, but raises since this is an immutable struct and only const is allowed
41
41
  sig {params(name: Symbol, cls: T.untyped, rules: T.untyped).void}
42
- def self.prop(name, cls, rules={})
42
+ def self.prop(name, cls, **rules)
43
43
  return super if (cls.is_a?(Hash) && cls[:immutable]) || rules[:immutable]
44
44
 
45
45
  raise "Cannot use `prop` in #{self.name} because it is an immutable struct. Use `const` instead"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sorbet-runtime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11422
4
+ version: 0.5.11429
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-08 00:00:00.000000000 Z
11
+ date: 2024-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest