class GoodData::Links
Attributes
Public Class Methods
Source
# File lib/gooddata/models/links.rb, line 13 def initialize(items) @data = {} items.values[0]['links'].each do |item| category = item['category'] if @data[category] if @data[category]['category'] == category @data[category] = { @data[category]['identifier'] => @data[category] } end @data[category][item['identifier']] = item else @data[category] = item end end end
Public Instance Methods
Source
# File lib/gooddata/models/links.rb, line 33 def [](category) return @data[category]['link'] if @data[category] && @data[category]['link'] @data[category] end
Source
# File lib/gooddata/models/links.rb, line 42 def ambiguous?(category) !unique?(category) end
Source
# File lib/gooddata/models/links.rb, line 46 def get(category, identifier) self[category][identifier] end
Source
# File lib/gooddata/models/links.rb, line 28 def links(category, identifier = nil) return Links.new(client.get(self[category])) unless identifier Links.new client.get(get(category, identifier)) end
Source
# File lib/gooddata/models/links.rb, line 38 def unique?(category) @data[category]['link'].is_a? String end