module ActiveFacts::Generators::ScalaTraits::Vocabulary

Public Instance Methods

scala_finale() click to toggle source
# File lib/activefacts/generators/traits/scala.rb, line 33
def scala_finale
  "}\n"+
  "\n"
end
scala_prelude() click to toggle source
# File lib/activefacts/generators/traits/scala.rb, line 12
def scala_prelude
  title_name = name.words.titlecase

  "package model\n"+
  "\n"+
  "import scala.language.implicitConversions\n" +
  "\n" +
  "object #{title_name} extends LocalStorageConstellation with #{title_name}\n" +
  "\n" +
  "trait #{title_name} extends Model {\n" +
  # REVISIT: I think this next line should be model, not metaModel
  "  val metaModel = new #{title_name}Model()\n" +
  "\n"
end
scala_prelude_metamodel() click to toggle source
# File lib/activefacts/generators/traits/scala.rb, line 27
def scala_prelude_metamodel
  title_name = name.words.titlecase
  "class #{title_name}Model extends FBMModel with LocalStorageConstellation {\n" +
  "  implicit val constellation: Constellation = this\n"
end