Sha256: 6f0cf8bbf3b0576d902b00dcebbe5fb4266ca7a407fd92ba167f4f4cd4ad1e07

Contents?: true

Size: 746 Bytes

Versions: 2

Compression:

Stored size: 746 Bytes

Contents

# encoding: UTF-8

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

2 entries across 2 versions & 1 rubygems

Version Path
gooddata-0.6.20 lib/gooddata/models/blueprint/attribute_field.rb
gooddata-0.6.19 lib/gooddata/models/blueprint/attribute_field.rb