Sha256: 3fc70a3bd4de335b6eabb8a77413912f2f9bdf65b99a861817f73f5e3448786d

Contents?: true

Size: 935 Bytes

Versions: 3

Compression:

Stored size: 935 Bytes

Contents

# encoding: UTF-8

require_relative '../metadata/column'

module GoodData
  module Model
    ##
    # GoodData fact abstraction
    #
    class Fact < Column
      def type_prefix
        FACT_PREFIX
      end

      def column_prefix
        FACT_COLUMN_PREFIX
      end

      def folder_prefix
        FACT_FOLDER_PREFIX
      end

      def table
        @schema.table
      end

      def column
        @column ||= table + '.' + column_prefix + name
      end

      def to_maql_create
        "CREATE FACT {#{identifier}} VISUAL (#{visual})" \
               + " AS {#{column}};\n"
      end

      def to_manifest_part(mode)
        {
          'populates' => [identifier],
          'mode' => mode,
          'columnName' => name
        }
      end

      def to_wire_model
        {
          'fact' => {
            'identifier' => identifier,
            'title' => title
          }
        }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gooddata-0.6.4 lib/gooddata/models/columns/fact_model.rb
gooddata-0.6.3 lib/gooddata/models/columns/fact_model.rb
gooddata-0.6.2 lib/gooddata/models/columns/fact_model.rb