clean Requester
This commit is contained in:
@@ -5,7 +5,7 @@ import java.nio.file.Path
|
||||
|
||||
class Function(
|
||||
override val script: String,
|
||||
override var source: Path? = null
|
||||
override val source: Path? = null
|
||||
) : Resource, ParametersInterface {
|
||||
val returns: String
|
||||
override val name: String
|
||||
|
||||
@@ -4,14 +4,12 @@ import java.nio.file.Path
|
||||
|
||||
class Migration(
|
||||
override val script: String,
|
||||
source: Path
|
||||
override var source: Path
|
||||
) : Resource {
|
||||
override val name: String
|
||||
val direction: Direction
|
||||
override var source: Path? = null
|
||||
|
||||
init {
|
||||
this.source = source
|
||||
this.direction = source.fileName.toString()
|
||||
.let {
|
||||
when {
|
||||
|
||||
@@ -4,9 +4,8 @@ import java.nio.file.Path
|
||||
|
||||
class Query(
|
||||
override val script: String,
|
||||
source: Path
|
||||
override var source: Path
|
||||
) : Resource {
|
||||
override var source: Path? = source
|
||||
override val name: String = getNameFromComment(script) ?: getNameFromFile(source)
|
||||
|
||||
/** Try to get name from comment in file */
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.nio.file.Path
|
||||
sealed interface Resource {
|
||||
val name: String
|
||||
val script: String
|
||||
var source: Path?
|
||||
val source: Path?
|
||||
|
||||
open class ParseException(message: String, cause: Throwable? = null) : Exception(message, cause)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user