types 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ba6a881d71e9cc56f38d4e6fa2d7508b2f884f33768de92842c97e2160a6955
4
- data.tar.gz: fcf5e669cb9e7d92a8a64a47bf74a1fb7a2504686da5bb2f5ab234239275ec21
3
+ metadata.gz: 1c110776ae58979679f2428639b072820f5dd04e8847475efadfb47a9dd656c0
4
+ data.tar.gz: 780e00a548c57bf6eb5e357b5b995e161e377a4620c4a6fe6088919c7399ff62
5
5
  SHA512:
6
- metadata.gz: '02978795e5d7bd65e5c7ecd54beff026802c3d9d142986a63eb3aa833db3db85f83849a9b97524ce78daa3c65952a27af9739bc48a26af65286b3f559f41a53f'
7
- data.tar.gz: 633f75598b51ec5c36bc7b5c1498bbd78dd2b5ff0c722e633df8591a66647d1edb151980461e0b4906633bdb7910154a2adf8443a1b582ab93571d99c29cd3ac
6
+ metadata.gz: 4bdc79038cdf89bb1fedbd371a3a7d3036591badebcf7614d7f5c08d780f40bd6cf4314a30b0981f51f3d5782ae7a205924096f9d16bbfed23a8467ab24c686a
7
+ data.tar.gz: dda80bab8fea54302452b0261777c800b3e50f4442678f10edbb35a4b21a855542f44cadce1f69e2b447d2a579e31bf7135c0f66f3ead059965952f5017f34ed
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/types/block.rb CHANGED
@@ -42,12 +42,12 @@ module Types
42
42
  end
43
43
  end
44
44
 
45
- # @returns [String] the RBS type string, e.g. `Proc[(String, Integer) -> String]`.
45
+ # @returns [String] the RBS type string, e.g. `^(String, Integer) -> String`.
46
46
  def to_rbs
47
47
  argument_types = @argument_types.map(&:to_rbs).join(", ")
48
48
  return_type = @return_type ? @return_type.to_rbs : "void"
49
49
 
50
- return "Proc[(#{argument_types}) -> #{return_type}]"
50
+ return "^(#{argument_types}) -> #{return_type}"
51
51
  end
52
52
  end
53
53
 
data/lib/types/hash.rb CHANGED
@@ -47,9 +47,9 @@ module Types
47
47
  "Hash(#{@key_type}, #{@value_type})"
48
48
  end
49
49
 
50
- # @returns [String] the RBS type string, e.g. `{ String => Integer }`.
50
+ # @returns [String] the RBS type string, e.g. `Hash[String, Integer]`.
51
51
  def to_rbs
52
- "{ #{@key_type.to_rbs} => #{@value_type.to_rbs} }"
52
+ "Hash[#{@key_type.to_rbs}, #{@value_type.to_rbs}]"
53
53
  end
54
54
 
55
55
  # Resolves to the actual Ruby Hash class.
data/lib/types/method.rb CHANGED
@@ -55,12 +55,9 @@ module Types
55
55
  return buffer
56
56
  end
57
57
 
58
- # @returns [String] the RBS type string, e.g. `Method[Receiver, (Args) -> Return]`.
58
+ # @returns [String] the RBS type string, e.g. `::Method`.
59
59
  def to_rbs
60
- argument_types = @argument_types.map(&:to_rbs).join(", ")
61
- return_type = @return_type ? @return_type.to_rbs : "void"
62
-
63
- return "Method[#{@receiver_type}, (#{argument_types}) -> #{return_type}]"
60
+ "Method"
64
61
  end
65
62
 
66
63
  # Parses the input as a method or proc.
data/lib/types/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2022-2025, by Samuel Williams.
5
5
 
6
6
  module Types
7
- VERSION = "0.4.1"
7
+ VERSION = "0.4.2"
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: types
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file