Sha256: f484b8b5f3503362fe934cbd8264f448c6e4bd47105b1ffa13f00ea00e064bec

Contents?: true

Size: 771 Bytes

Versions: 2

Compression:

Stored size: 771 Bytes

Contents

module GoodData
  class Report < GoodData::MdObject 

    class << self
      def [](id)
        if id == :all
          GoodData.get(GoodData.project.md['query'] + '/reports/')['query']['entries']
        else 
          super
        end
      end
    end

    def execute
      # puts "Executing report #{uri}"
      result = GoodData.post '/gdc/xtab2/executor3', {"report_req" => {"report" => uri}}
      dataResultUri = result["reportResult2"]["content"]["dataResult"]

      result = GoodData.get dataResultUri
      while result["taskState"] && result["taskState"]["state"] == "WAIT" do
        sleep 10
        result = GoodData.get dataResultUri
      end
      data_result = ReportDataResult.new(GoodData.get dataResultUri)
      data_result
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gooddata-0.5.0 lib/gooddata/models/report.rb
gooddata-0.4.0 lib/gooddata/models/report.rb