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

com.andrewmccall.faker.module.books.Dune.scala Maven / Gradle / Ivy

The newest version!
package com.andrewmccall.faker.module.books

import com.andrewmccall.faker.module.{faker, namespace}
import com.andrewmccall.faker.{Config, Faker}

@namespace("book")
class Dune (faker: Faker, config: Config) {

  @faker
  def quote(character: String = null) {
    val searchCharacter = if (character == null) {
      faker.sample(faker.fetchKeys("dune.quotes").toSeq)
    } else character.toLowerCase
    faker("dune.quotes" + searchCharacter)
  }

  @faker
  def saying(source: String = null) {

    val searchSource = if (source == null) {
      faker.sample(faker.fetchKeys("dune.sayings").toSeq)
    } else source.toLowerCase
    faker("dune.quotes" + searchSource)

  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy