Class: GoodData::Model::AttributeBlueprintField

Inherits:
BlueprintField show all
Defined in:
lib/gooddata/models/blueprint/attribute_field.rb

Direct Known Subclasses

AnchorBlueprintField

Instance Attribute Summary

Attributes inherited from BlueprintField

#data, #dataset_blueprint

Instance Method Summary collapse

Methods inherited from BlueprintField

#==, #id, #in_project, #initialize, #method_missing, #respond_to?, #title

Constructor Details

This class inherits a constructor from GoodData::Model::BlueprintField

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GoodData::Model::BlueprintField

Instance Method Details

#labelsArray

Returns list of labels on the attribute. There has to be always at least one attribute

Returns:

  • (Array)

    returns list of the errors represented by hash structures



15
16
17
# File 'lib/gooddata/models/blueprint/attribute_field.rb', line 15

def labels
  @dataset_blueprint.labels_for_attribute(self)
end

#validateArray

Validates the fields in the attribute

Returns:

  • (Array)

    returns list of the errors represented by hash structures



22
23
24
25
26
# File 'lib/gooddata/models/blueprint/attribute_field.rb', line 22

def validate
  validate_presence_of(:id).map do |e|
    { type: :error, message: "Field \"#{e}\" is not defined or empty for attribute \"#{id}\"" }
  end
end