Sha256: 083fda4325213f2a53a2c54de28ccd8bc3015f80e553d5728fe8d480c5c0e9f4

Contents?: true

Size: 1.41 KB

Versions: 60

Compression:

Stored size: 1.41 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

require_relative 'blueprint_field'

module GoodData
  module Model
    class BridgeBlueprintField < BlueprintField
      # Returns the schema that is referenced by this ref
      #
      # @return [GoodData::Model::SchemaBlueprint] the referencesd schema
      def dataset
        dataset_blueprint.find_dataset(bridge, include_date_dimensions: true)
      end

      # Returns the string bridge of the ref which is string Id of dataset that is bridged.
      #
      # @return [String] Id of the bridged dataset
      def bridge
        data[:dataset]
      end

      # Validates the fields in the ref
      #
      # @return [Array] returns list of the errors represented by hash structures
      def validate
        validate_presence_of(:dataset).map do |e|
          { type: :error, message: "Field \"#{e}\" is not defined or empty for bridge \"#{data}\"" }
        end
      end

      # Returns the md object in associated project or throws error if not present
      #
      # @return [GoodData::MdObject] md object that is represented in the blueprint
      def in_project(_project)
        fail NotImplementedError, 'Reference does not have representation as an object in datamart'
      end
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
gooddata-2.1.10-java lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.10 lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.9-java lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.9 lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.8-java lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.8 lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.7-java lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.7 lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.6-java lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.6 lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.5-java lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.5 lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.4-java lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.4 lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.3-java lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.3 lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.2-java lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.2 lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.1-java lib/gooddata/models/blueprint/bridge_field.rb
gooddata-2.1.1 lib/gooddata/models/blueprint/bridge_field.rb