Sha256: 956bf4c95fff5a293d6f253af49d10285128d5435f0d98c0f6f02032ce0af258

Contents?: true

Size: 712 Bytes

Versions: 11

Compression:

Stored size: 712 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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
activefacts-0.8.16 lib/activefacts/generate/text.rb
activefacts-0.8.15 lib/activefacts/generate/text.rb
activefacts-0.8.13 lib/activefacts/generate/text.rb
activefacts-0.8.12 lib/activefacts/generate/text.rb
activefacts-0.8.10 lib/activefacts/generate/text.rb
activefacts-0.8.9 lib/activefacts/generate/text.rb
activefacts-0.8.8 lib/activefacts/generate/text.rb
activefacts-0.8.6 lib/activefacts/generate/text.rb
activefacts-0.8.5 lib/activefacts/generate/text.rb
activefacts-0.7.3 lib/activefacts/generate/text.rb
activefacts-0.7.2 lib/activefacts/generate/text.rb