Docs: Add example for casting to API doc (#5010)

* Docs: Add example for casting to API doc

* Update api.md
This commit is contained in:
Marc Bernard 2021-10-05 08:57:04 -04:00 committed by GitHub
parent 2b8c21bdbc
commit 8ec439b9a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,10 +56,20 @@ Get an instance of a repository:
DATA(lo_repo) = zcl_abapgit_repo_srv=>get_instance( )->get( iv_key ).
```
Cast to online or offline repository:
```abap
DATA lo_repo_online TYPE REF TO zcl_abapgit_repo_online.
lo_repo_online ?= lo_repo.
DATA lo_repo_offline TYPE REF TO zcl_abapgit_repo_offline.
lo_repo_offline ?= lo_repo.
```
Get a structure containing all properties and local settings of a repository:
```abap
DATA(ls_repo) = NEW zcl_abapgit_persistence_repo( )->read( iv_key ).
DATA(ls_repo) = NEW zcl_abapgit_persist_factory=>get_repo( )->read( iv_key ).
```
### Find ###