-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to fetch variation detail for json and json list values (#5)
* Add json variation detail to the getJsonValue function. * Add support for fetching json value and list variation detail * Fix detekt issues. * Changes to pass klint check
- Loading branch information
Showing
6 changed files
with
193 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 24 additions & 1 deletion
25
library/src/androidMain/kotlin/com/myunidays/launchdarkly/EvaluationDetail.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
library/src/iosMain/kotlin/com/myunidays/launchdarkly/JsonValueEvaluationDetail.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.myunidays.launchdarkly | ||
|
||
class JsonValueEvaluationDetail<T> internal constructor( | ||
private val ios: cocoapods.LaunchDarkly.LDJSONEvaluationDetail, | ||
override val value: T | ||
) : | ||
EvaluationDetailInterface<T> { | ||
override val variationIndex: Int | ||
get() = ios.variationIndex().toInt() | ||
override val reason: EvaluationReason? | ||
get() = ios.reason()?.let { EvaluationReason(it) } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters