Class: GoodData::Model::BridgeBlueprintField

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

Instance Attribute Summary

Attributes inherited from BlueprintField

#data, #dataset_blueprint

Instance Method Summary collapse

Methods inherited from BlueprintField

#==, #id, #initialize, #method_missing, #respond_to_missing?, #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

#bridgeString

Returns the string bridge of the ref which is string Id of dataset that is bridged.

Returns:

  • (String)

    Id of the bridged dataset



22
23
24
# File 'lib/gooddata/models/blueprint/bridge_field.rb', line 22

def bridge
  data[:dataset]
end

#datasetGoodData::Model::SchemaBlueprint

Returns the schema that is referenced by this ref

Returns:



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

def dataset
  dataset_blueprint.find_dataset(bridge, include_date_dimensions: true)
end

#in_project(_project) ⇒ GoodData::MdObject

Returns the md object in associated project or throws error if not present

Returns:



38
39
40
# File 'lib/gooddata/models/blueprint/bridge_field.rb', line 38

def in_project(_project)
  fail NotImplementedError, 'Reference does not have representation as an object in datamart'
end

#validateArray

Validates the fields in the ref

Returns:

  • (Array)

    returns list of the errors represented by hash structures



29
30
31
32
33
# File 'lib/gooddata/models/blueprint/bridge_field.rb', line 29

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