Module: ActiveFacts::Generators::ScalaTraits::Vocabulary

Defined in:
lib/activefacts/generators/traits/scala.rb

Instance Method Summary collapse

Instance Method Details

#scala_finaleObject



33
34
35
36
# File 'lib/activefacts/generators/traits/scala.rb', line 33

def scala_finale
  "}\n"+
  "\n"
end

#scala_preludeObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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_metamodelObject



27
28
29
30
31
# 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