mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 09:20:03 +02:00
1119 Support method return types
Small refactor to split out logic for determining method display text and style. Updated documentation Used regex to parse method statements in class diagrams to extract discrete elements to set display appropriately. Added tests and updated docs
This commit is contained in:
@@ -115,7 +115,7 @@ There are two ways to define the members of a class, and regardless of whichever
|
||||
class BankAccount
|
||||
BankAccount : +String owner
|
||||
BankAccount : +BigDecimal balance
|
||||
BankAccount : +deposit(amount) [bool]
|
||||
BankAccount : +deposit(amount) bool
|
||||
BankAccount : +withdrawal(amount)
|
||||
```
|
||||
``` mermaid
|
||||
@@ -132,7 +132,7 @@ There are two ways to define the members of a class, and regardless of whichever
|
||||
class BankAccount{
|
||||
+String owner
|
||||
+BigDecimal balance
|
||||
+deposit(amount) [bool]
|
||||
+deposit(amount) bool
|
||||
+withdrawl(amount)
|
||||
}
|
||||
```
|
||||
@@ -147,6 +147,9 @@ class BankAccount{
|
||||
```
|
||||
|
||||
|
||||
#### Return Type
|
||||
Optionally you can end the method/function definition with the data type that will be returned
|
||||
|
||||
#### Visibility
|
||||
To specify the visibility of a class member (i.e. any attribute or method), these notations may be placed before the member's name, but it is optional:
|
||||
|
||||
|
Reference in New Issue
Block a user