Skip to content

Commit b5c3124

Browse files
committed
Initializer: added Person class for test initializer
1 parent 5fbbe13 commit b5c3124

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

isc/py/init/Test.cls

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,18 @@ ClassMethod InitAllargs() As %Status [ CodeMode = expression ]
4444
" print(""kwarg: {0} = {1}"".format(key, value))")
4545
}
4646

47+
ClassMethod InitPerson() As %Status [ CodeMode = expression ]
48+
{
49+
##class(isc.py.Main).SimpleString( "class Person(object):" _ $c(10) _
50+
" def __init__(self, name, age, city):" _ $c(10) _
51+
" self.name = name" _ $c(10) _
52+
" self.age = age" _ $c(10) _
53+
" self.city = city" _ $c(10) _
54+
" def getAge(self):" _ $c(10) _
55+
" return self.age" _ $c(10) _
56+
" def getAgePlus(self, add):" _ $c(10) _
57+
" return self.age + add")
58+
}
59+
4760
}
4861

0 commit comments

Comments
 (0)