TagCompanion

abstract class TagCompanion[S, T <: Tag](implicit extractor: SeedExtractor[S]) extends Companion[S]

Similar to Companion, but used when you don't want to define the Companion#Tag on the companion object of the model that you are using as a seed.

Instead you can define a separate tag class and use this as the companion object for that tag type.

 final case class UserId(value: String)

 // in some other part of the code
 sealed abstract class UserIdSeeded extends SeededGen.Tag
 object UserIdSeeded extends SeededGen.TagCompanion[UserId, UserIdSeeded]

This will give you a uniform syntax for constructing seeded generators.

   val example: UserIdSeeded.Gen[String] = UserIdSeeded.gen(implicit userId => Gen.string)
class Companion[S]
class Object
trait Matchable
class Any

Type members

Types

override type Tag = T

Inherited types

type Gen[V] = SeededGen[S, Tag, V]
Inherited from:
Companion

Value members

Inherited methods

def gen[V](genFn: (S, Tag) => V): Gen[V]
Inherited from:
Companion

Implicits

Inherited implicits

implicit val seedExtractor: SeedExtractor[S]
Inherited from:
Companion