Skip to content

Commit

Permalink
Merge pull request #406 from NthPortal/attribute-creation/PR
Browse files Browse the repository at this point in the history
Improve `Attribute` creation ergonomics
  • Loading branch information
iRevive authored Dec 19, 2023
2 parents 86bdb67 + bbf2d65 commit 19b248d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ import cats.syntax.show._
sealed trait AttributeKey[A] {
def name: String
def `type`: AttributeType[A]

/** @return
* an [[`Attribute`]] associating this key with the given value
*/
final def apply(value: A): Attribute[A] = Attribute(this, value)
}

object AttributeKey {
Expand Down

0 comments on commit 19b248d

Please sign in to comment.