Skip to content

Commit 1f8b8de

Browse files
author
Pere Urbon-Bayes
committed
add notes into the basic.rb file to describe what the code is doing.
1 parent e993885 commit 1f8b8de

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

extensions/basic/basic.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,31 @@
44
require "com/purbon/basic"
55

66

7+
##
8+
# Using a class created in the jruby side, this class has for example a method with aliases, etc.
9+
##
710
bar = Bar.new
811

12+
##
13+
# Calling a method form the class that has two names, throw aliases. This method return a simple
14+
# string from the java side.
15+
##
916
puts bar.say
1017
puts bar.shout
1118

19+
##
20+
# Using a module defined in the extensione.
21+
# Foo is a module defined in jruby extension point.
22+
##
1223
class MyRubyClass
1324
include Foo
1425
end
1526

27+
##
28+
# Using a method defined in the module, but form the created class.
29+
##
1630
puts MyRubyClass.new.build_string
31+
##
32+
# Using the same method but as static method defined in the module.
33+
##
1734
puts Foo.build_string

0 commit comments

Comments
 (0)