From df173406d4924fdb69493edeed78970b4505df51 Mon Sep 17 00:00:00 2001 From: Loris Perret Date: Thu, 18 Jul 2024 11:36:11 +0200 Subject: [PATCH] Update README.md --- README.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 435ac6b..3b85ede 100644 --- a/README.md +++ b/README.md @@ -192,12 +192,41 @@ You can use parameters in generate methods. 1. `name`: name of the parameter 2. `type`: type of the parameter (Int, String, Bool, Double) +3. `value`: value of the parameter +4. `defaultValue`: defaultValue of the parameter 3. `replaceIn` *(optional)* +**Value** + +If you want to send another parameter with a static value. For example, you want to send to which screen the event is triggered. +You can add the parameter 'screenName' for example and its 'value' is 'Home'. With this, you do not need to specify the value in the function call. + +**DefaultValue** + +If you want ta add a parameter in the call of the function but you want to make it optionnal with a default value you need to use this property. + +Example: +``` +events: + id: id_of_tag + name: _TITLE_ + tags: ios,droid + parameters: + - name: title + type: String + defaultValue: someTitle +``` + +The generated method will be: +``` +logIdOfTag(title: String = "someTitle") +``` + **Replace in** This is section is equivalent of `%s | %d | %f | %@`. You can put the content of the parameter in *name*, *path*, *action*, *category*. -You need to put `_` + `NAME OF THE PARAMETER` + `_` in the target and which target you want in the value of `replaceIn`. (name need to be in uppercase) +You need to put `_` + `NAME OF THE PARAMETER` + `_` in the target and which target you want in the value of `replaceIn`. (name need to be in uppercase). +You can't use `value`and `replaceIn`in thge same time. Example: ``` @@ -218,6 +247,23 @@ The generated method will be: logIdOfTag(title: String) ``` +You can also want to replace a parameter in an other parameter. You can do this with the `replaceIn` property. The condition is that the parameter which will use the `replaceIn`need to have the `value`property + +Example: +``` +events: + id: id_of_tag + name: title + tags: ios,droid + parameters: + - name: something + type: String + value: test _TEXT_ + - name: text + type: String + replaceIn: something +``` + ## Images Images generator will generate images assets along with extensions to access those images easily.