Sha256: f945e52b2ffd0ca769c76a9ad8ab7b76074579d51036b45654e2fb858f5c95d6

Contents?: true

Size: 1.56 KB

Versions: 26

Compression:

Stored size: 1.56 KB

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

module GoodData
  class ReportAttachment
    include GoodData::Mixin::RootKeyGetter
    include GoodData::Mixin::DataGetter

    attr_reader :scheduled_email
    attr_accessor :json

    DEFAULT_OPTS = {
      :formats => %w(pdf xls),
      :exportOptions => {
        :pageOrientation => 'landscape'
      }
    }

    def initialize(scheduled_email, json)
      @scheduled_email = scheduled_email
      @json = json
    end

    # Get export options settings
    #
    # @return [Hash] Export options settings
    def export_options
      data['exportOptions']
    end

    # Set export options settings
    #
    # @param [Hash] new_export_options New export options settings to be set
    # @return [Hash] New export options settings
    def export_options=(new_export_options)
      data['exportOptions'] = new_export_options
    end

    # Get formats
    #
    # @return [Array<String>] List of selected formats
    def formats
      data['formats']
    end

    # Set formats
    #
    # @param [String | Array<String>] new_formats New list of selected formats to be set
    # @return [Array<String>] New list of selected formats
    def formats=(new_formats)
      data['formats'] = new_formats.is_a?(Array) ? new_formats : [new_formats]
    end

    # Get attachment URI
    #
    # @return [String] Attachment URI
    def uri
      data['uri']
    end
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
gooddata-0.6.30 lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb
gooddata-0.6.29 lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb
gooddata-0.6.28 lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb
gooddata-0.6.27 lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb
gooddata-0.6.26 lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb
gooddata-0.6.25 lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb