Method: GoodData::Model::ProjectBlueprint.find_dataset

Defined in:
lib/gooddata/models/blueprint/project_blueprint.rb

.find_dataset(project_blueprint, obj, options = {}) ⇒ GoodData::Model::DatasetBlueprint

Returns dataset specified. It can check even for a date dimension

Parameters:

Options Hash (options):

  • :include_date_dimensions (Boolean)

    Specifies whether to include date dimensions

  • :dd (Boolean)

    Specifies whether to include date dimensions

Returns:



138
139
140
141
142
143
144
145
# File 'lib/gooddata/models/blueprint/project_blueprint.rb', line 138

def self.find_dataset(project_blueprint, obj, options = {})
  return obj.to_hash if DatasetBlueprint.dataset_blueprint?(obj)
  all_datasets = datasets(project_blueprint, options)
  name = obj.respond_to?(:to_hash) ? obj.to_hash[:id] : obj
  ds = all_datasets.find { |d| d[:id] == name }
  fail "Dataset #{name} could not be found" if ds.nil?
  ds
end