Sha256: bf3a8f9cc877bcb03d5790cf5632a0ae7baba7835d4434f6fd9c41016dfad6d6

Contents?: true

Size: 947 Bytes

Versions: 29

Compression:

Stored size: 947 Bytes

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2015 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 AttributeBlueprintField < BlueprintField
      # Returns list of labels on the attribute. There has to be always at least one attribute
      #
      # @return [Array] returns list of the errors represented by hash structures
      def labels
        @dataset_blueprint.labels_for_attribute(self)
      end

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

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
gooddata-0.6.30 lib/gooddata/models/blueprint/attribute_field.rb
gooddata-0.6.29 lib/gooddata/models/blueprint/attribute_field.rb
gooddata-0.6.28 lib/gooddata/models/blueprint/attribute_field.rb
gooddata-0.6.27 lib/gooddata/models/blueprint/attribute_field.rb
gooddata-0.6.26 lib/gooddata/models/blueprint/attribute_field.rb
gooddata-0.6.25 lib/gooddata/models/blueprint/attribute_field.rb
gooddata-0.6.24 lib/gooddata/models/blueprint/attribute_field.rb
gooddata-0.6.23 lib/gooddata/models/blueprint/attribute_field.rb
gooddata-0.6.22 lib/gooddata/models/blueprint/attribute_field.rb