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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/types/block.rb +2 -2
- data/lib/types/hash.rb +2 -2
- data/lib/types/method.rb +2 -5
- data/lib/types/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c110776ae58979679f2428639b072820f5dd04e8847475efadfb47a9dd656c0
|
4
|
+
data.tar.gz: 780e00a548c57bf6eb5e357b5b995e161e377a4620c4a6fe6088919c7399ff62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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 "
|
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. `
|
50
|
+
# @returns [String] the RBS type string, e.g. `Hash[String, Integer]`.
|
51
51
|
def to_rbs
|
52
|
-
"
|
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.
|
58
|
+
# @returns [String] the RBS type string, e.g. `::Method`.
|
59
59
|
def to_rbs
|
60
|
-
|
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
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|