Method: GoodData::Project#find_by_tag

Defined in:
lib/gooddata/models/project.rb

#find_by_tag(tags) ⇒ Object



1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
# File 'lib/gooddata/models/project.rb', line 1217

def find_by_tag(tags)
  tags = tags.split(',').map(&:strip) unless tags.is_a?(Array)

  objects = tags.map do |tag|
    url = "/gdc/md/#{pid}/tags/#{tag}"
    res = client.get(url)

    ((res || {})['entries'] || []).map do |entry|
      entry['link']
    end
  end

  objects.flatten!

  objects.uniq!

  objects
end