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 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` /// - note: Default implementation provided for types conforming to `Decodable`
public protocol ExplorerValueCreatable { public protocol ExplorerValueCreatable {
@ -23,7 +23,7 @@ public protocol ExplorerValueCreatable {
init(from explorerValue: ExplorerValue) throws 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` /// - note: Default implementation provided for types conforming to `Codable`
public typealias ExplorerValueConvertible = ExplorerValueRepresentable & ExplorerValueCreatable public typealias ExplorerValueConvertible = ExplorerValueRepresentable & ExplorerValueCreatable

View File

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

View File

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

View File

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