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
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, = {}) return obj.to_hash if DatasetBlueprint.dataset_blueprint?(obj) all_datasets = datasets(project_blueprint, ) 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 |