All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.malliina.html.UserFeedback.scala Maven / Gradle / Ivy

There is a newer version: 6.9.4
Show newest version
package com.malliina.html

import com.malliina.html.UserFeedback.{Feedback, No, Success, Yes}

case class UserFeedback(message: String, isError: Boolean) {
  def toMap: Seq[(String, String)] = Seq(
    Feedback -> message,
    Success -> (if (isError) No else Yes)
  )
}

object UserFeedback {
  val Feedback = "feedback"
  val Success = "success"
  val Yes = "yes"
  val No = "no"

  def success(message: String) = UserFeedback(message, isError = false)

  def error(message: String) = UserFeedback(message, isError = true)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy