Updated comments and doc

This commit is contained in:
Alexis Bridoux 2022-03-19 19:11:38 +01:00
parent 94df6e5659
commit d0d2a50f38
4 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ public protocol ExplorerValueRepresentable {
func explorerValue() throws -> ExplorerValue
}
/// Can be instantiated from an `ExplorerValue`
/// Can be instantiated from an ``ExplorerValue``
/// - note: Default implementation provided for types conforming to `Decodable`
public protocol ExplorerValueCreatable {
@ -23,7 +23,7 @@ public protocol ExplorerValueCreatable {
init(from explorerValue: ExplorerValue) throws
}
/// Can be represented *as* and instantiated *from* an `ExplorerValue`
/// Can be represented *as* and instantiated *from* an ``ExplorerValue``
/// - note: Default implementation provided for types conforming to `Codable`
public typealias ExplorerValueConvertible = ExplorerValueRepresentable & ExplorerValueCreatable

View File

@ -21,6 +21,7 @@ Supported formats:
- ``PathExplorer``
- ``PathExplorers``
- ``ExplorerValue``
- ``ExplorerError``
### Manipulate paths
@ -47,7 +48,6 @@ Supported formats:
### Set and add custom types
- <doc:custom-types-explorerValue>
- ``ExplorerValue``
- ``ExplorerValueCreatable``
- ``ExplorerValueRepresentable``
- ``ExplorerValueConvertible``

View File

@ -8,12 +8,11 @@ import Scout
/// Type serving only the purpose to map dictionaries or arrays
/// returned by a `PathExplorer` to a `String` value.
///
/// Init throws if the value is not single.
public struct GroupExportValue: ExplorerValueCreatable {
public let value: String
/// - throws: if the value is not single.
public init(from explorerValue: ExplorerValue) throws {
switch explorerValue {
case .string(let string): value = string

View File

@ -5,6 +5,7 @@
import Scout
/// The possible types when setting values in a path
public enum ValueType: Equatable {
case string(String)
case real(String)