Sha256: 2ceeb6dbd6514e818304613066b659d1546d73524c3119147ea548e18ee47f21

Contents?: true

Size: 1.3 KB

Versions: 9

Compression:

Stored size: 1.3 KB

Contents

# encoding: UTF-8

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

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

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

      alias_method :used_by, :usedby

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

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

      alias_method :used_by?, :usedby?

      # Checks if obj is using this MD resource
      def using?(obj, opts = { :client => client, :project => project })
        dependency?(:using, obj, opts)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gooddata-0.6.20 lib/gooddata/mixins/md_relations.rb
gooddata-0.6.19 lib/gooddata/mixins/md_relations.rb
gooddata-0.6.18 lib/gooddata/mixins/md_relations.rb
gooddata-0.6.17 lib/gooddata/mixins/md_relations.rb
gooddata-0.6.16 lib/gooddata/mixins/md_relations.rb
gooddata-0.6.15 lib/gooddata/mixins/md_relations.rb
gooddata-0.6.14 lib/gooddata/mixins/md_relations.rb
gooddata-0.6.13 lib/gooddata/mixins/md_relations.rb
gooddata-0.6.12 lib/gooddata/mixins/md_relations.rb