Updated comments and doc
This commit is contained in:
parent
94df6e5659
commit
d0d2a50f38
|
@ -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
|
||||
|
||||
|
|
|
@ -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``
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue