Module: GoodData::Mixin::MdRelations

Included in:
GoodData::MdObject
Defined in:
lib/gooddata/mixins/md_relations.rb

Instance Method Summary collapse

Instance Method Details

#dependency(uri, key = nil, opts = { :client => client, :project => project }) ⇒ Object



10
11
12
# File 'lib/gooddata/mixins/md_relations.rb', line 10

def dependency(uri, key = nil, opts = { :client => client, :project => project })
  GoodData::MdObject.dependency(uri, key, opts)
end

#dependency?(type, obj, opts = { :client => client, :project => project }) ⇒ Boolean

Checks for dependency

Returns:

  • (Boolean)


15
16
17
# File 'lib/gooddata/mixins/md_relations.rb', line 15

def dependency?(type, obj, opts = { :client => client, :project => project })
  GoodData::MdObject.dependency?(type, self, obj, opts)
end

#usedby(key = nil, opts = { :client => client, :project => project }) ⇒ Object Also known as: used_by

Returns which objects uses this MD resource



20
21
22
# File 'lib/gooddata/mixins/md_relations.rb', line 20

def usedby(key = nil, opts = { :client => client, :project => project })
  dependency("#{project.md['usedby2']}/#{obj_id}", key, { :client => client, :project => project }.merge(opts))
end

#usedby?(obj, opts = { :client => client, :project => project }) ⇒ Boolean Also known as: used_by?

Returns:

  • (Boolean)


31
32
33
# File 'lib/gooddata/mixins/md_relations.rb', line 31

def usedby?(obj, opts = { :client => client, :project => project })
  GoodData::MdObject.used_by?(self, obj, opts)
end

#using(key = nil, opts = { :client => client, :project => project }) ⇒ Object

Returns which objects this MD resource uses



27
28
29
# File 'lib/gooddata/mixins/md_relations.rb', line 27

def using(key = nil, opts = { :client => client, :project => project })
  dependency("#{project.md['using2']}/#{obj_id}", key, { :client => client, :project => project }.merge(opts))
end

#using?(obj, opts = { :client => client, :project => project }) ⇒ Boolean

Checks if obj is using this MD resource

Returns:

  • (Boolean)


38
39
40
# File 'lib/gooddata/mixins/md_relations.rb', line 38

def using?(obj, opts = { :client => client, :project => project })
  dependency?(:using, obj, opts)
end