Creates instance of specified class.
classes:new ClassName var 12345
$var::methodFoo
- classes:require
Source file with class declaration.
Class should be declared using following syntax:
@class ClassName
@method methodFoo() {
# here is available two variables
# $this refers to current instance
# $identifier string representation of object identifier
echo "Was created with following identifier: $identifier"
$this::methodBar arg1
}
@method methodBar() {
echo "There is same identifier: $identifier"
echo "args: $@"
}
classes:require foo.class.sh
classes:new Foo var
$var::methodFoo