Skip to content

Commit 3ea1e62

Browse files
committed
Init Kernel#define_type
1 parent d9579d3 commit 3ea1e62

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

lib/java.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ def new(klass)
2424
end
2525
end
2626

27+
def define_type(type, type_klass, &condition)
28+
Module.class_eval do
29+
define_method(type) do |meth|
30+
define_typed_method(meth, type, type_klass, &condition)
31+
end
32+
private type
33+
end
34+
end
35+
2736
def method_missing(meth, *args, &block)
2837
[Object.const_get(meth), args, block]
2938
rescue NameError

0 commit comments

Comments
 (0)