Skip to content
This repository was archived by the owner on Nov 10, 2017. It is now read-only.

Commit 20ae83e

Browse files
author
Ary Borenszweig
committed
Added class usage sample
1 parent 512ad65 commit 20ae83e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

samples/class.cr

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Foo
2+
def initialize(x)
3+
@x = x
4+
end
5+
6+
def x
7+
@x
8+
end
9+
end
10+
11+
f1 = Foo.new 1
12+
f2 = Foo.new 2.0
13+
14+
puts(f1.x + f2.x)

0 commit comments

Comments
 (0)