Sha256: 98e1934513abb45af4622cc60add39ce6a6a8db784be27bb52a241c153e1f728

Contents?: true

Size: 781 Bytes

Versions: 13

Compression:

Stored size: 781 Bytes

Contents

#
#       ActiveFacts Generators.
#       Generate text output (verbalise the meta-vocabulary) for ActiveFacts vocabularies.
#
# Copyright (c) 2009 Clifford Heath. Read the LICENSE file.
#
module ActiveFacts
  module Generate
    # Generate a text verbalisation of the metamodel constellation created for an ActiveFacts vocabulary.
    # Invoke as
    #   afgen --text <file>.cql
    class TEXT
    private
      def initialize(vocabulary)
        @vocabulary = vocabulary
        @vocabulary = @vocabulary.Vocabulary.values[0] if ActiveFacts::API::Constellation === @vocabulary
      end

    public
      def generate(out = $>)
        out.puts @vocabulary.constellation.verbalise
      end
    end
  end
end

ActiveFacts::Registry.generator('text', ActiveFacts::Generate::TEXT)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
activefacts-1.6.0 lib/activefacts/generate/text.rb
activefacts-1.5.3 lib/activefacts/generate/text.rb
activefacts-1.5.2 lib/activefacts/generate/text.rb
activefacts-1.5.1 lib/activefacts/generate/text.rb
activefacts-1.5.0 lib/activefacts/generate/text.rb
activefacts-1.3.0 lib/activefacts/generate/text.rb
activefacts-1.2.1 lib/activefacts/generate/text.rb
activefacts-1.2.0 lib/activefacts/generate/text.rb
activefacts-1.1.0 lib/activefacts/generate/text.rb
activefacts-1.0.2 lib/activefacts/generate/text.rb
activefacts-1.0.1 lib/activefacts/generate/text.rb
activefacts-1.0.0 lib/activefacts/generate/text.rb
activefacts-0.8.18 lib/activefacts/generate/text.rb