From f2bfbc788a995daed52d3c0d587223d7b21cb3cc Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Wed, 26 Sep 2018 00:32:08 +0300 Subject: Refactor platforms & SinceKotlin logic --- core/src/main/kotlin/Model/DocumentationNode.kt | 7 +++++++ core/src/main/kotlin/Model/DocumentationReference.kt | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'core/src/main/kotlin/Model') diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt index f2b3a937..5607c6d3 100644 --- a/core/src/main/kotlin/Model/DocumentationNode.kt +++ b/core/src/main/kotlin/Model/DocumentationNode.kt @@ -116,6 +116,13 @@ open class DocumentationNode(val name: String, val externalType: DocumentationNode? get() = references(RefKind.ExternalType).map { it.to }.firstOrNull() + var sinceKotlin: String? + get() = references(RefKind.SinceKotlin).singleOrNull()?.to?.name + set(value) { + if(value == null) return dropReferences { it.kind == RefKind.SinceKotlin } + append(DocumentationNode(value, Content.Empty, NodeKind.Value), RefKind.SinceKotlin) + } + val supertypes: List get() = details(NodeKind.Supertype) diff --git a/core/src/main/kotlin/Model/DocumentationReference.kt b/core/src/main/kotlin/Model/DocumentationReference.kt index e10796d2..1f2fc0c9 100644 --- a/core/src/main/kotlin/Model/DocumentationReference.kt +++ b/core/src/main/kotlin/Model/DocumentationReference.kt @@ -20,7 +20,8 @@ enum class RefKind { TopLevelPage, Platform, ExternalType, - Origin + Origin, + SinceKotlin } data class DocumentationReference(val from: DocumentationNode, val to: DocumentationNode, val kind: RefKind) { -- cgit