Module: GoodData::Mixin::MdRelations
- Included in:
- GoodData::MdObject
- Defined in:
- lib/gooddata/mixins/md_relations.rb
Instance Method Summary collapse
- #dependency(uri, key = nil, opts = { :client => client, :project => project }) ⇒ Object
-
#dependency?(type, obj, opts = { :client => client, :project => project }) ⇒ Boolean
Checks for dependency.
-
#usedby(key = nil, opts = { :client => client, :project => project }) ⇒ Object
(also: #used_by)
Returns which objects uses this MD resource.
- #usedby?(obj, opts = { :client => client, :project => project }) ⇒ Boolean (also: #used_by?)
-
#using(key = nil, opts = { :client => client, :project => project }) ⇒ Object
Returns which objects this MD resource uses.
-
#using?(obj, opts = { :client => client, :project => project }) ⇒ Boolean
Checks if obj is using this MD resource.
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
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?
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
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 |