Sha256: 8ff48450d7bc2389ab4469d049c0f078c334e0192cf6a68fb0c9dd04287a578a

Contents?: true

Size: 711 Bytes

Versions: 1

Compression:

Stored size: 711 Bytes

Contents

# encoding: UTF-8

require_relative 'metadata.rb'

module GoodData
  class DataSet < MdObject
    root_key :dataSet

    SLI_CTG = 'singleloadinterface'
    DS_SLI_CTG = 'dataset-singleloadinterface'

    def sli_enabled?
      content['mode'] == 'SLI'
    end

    def sli
      raise NoProjectError.new 'Connect to a project before searching for an object' unless GoodData.project
      slis = GoodData.project.md.links(Model::LDM_CTG).links(SLI_CTG)[DS_SLI_CTG]
      uri = slis[identifier]['link']
      MdObject[uri]
    end

    def attributes
      content['attributes'].map { |a| GoodData::Attribute[a] }
    end

    def facts
      content['facts'].map { |a| GoodData::Attribute[a] }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gooddata-0.6.0 lib/gooddata/models/data_set.rb