Skip to content

Commit

Permalink
More reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
samdeane committed Apr 27, 2022
1 parent 3e4d4f5 commit 5a91b7d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Sources/Lilliput/Definition+Reflection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,29 @@
import Foundation

public extension Definition {
static let labels = [
"strings.definite": "Definite Name",
"strings.indefinite": "Indefinite Name",
"strings.location": "Location Description",
"strings.detailed": "Object Description"
]

var generalDescriptionKeys: [String] {
return ["indefinite", "definite", "detailed"]
}

func label(forPath path: String) -> String {

return Self.labels[path] ?? path
}

func pathIsMultiline(_ path: String) -> Bool {
switch path {
case "strings.detailed", "strings.location":
return true

default:
return false
}
}
}

0 comments on commit 5a91b7d

Please sign in to comment.