Class: GoodData::ReportAttachment

Inherits:
Object
  • Object
show all
Includes:
Mixin::DataGetter, Mixin::RootKeyGetter
Defined in:
lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mixin::DataGetter

#data

Methods included from Mixin::RootKeyGetter

#root_key

Constructor Details

#initialize(scheduled_email, json) ⇒ ReportAttachment

Returns a new instance of ReportAttachment.



22
23
24
25
# File 'lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb', line 22

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

Instance Attribute Details

#jsonObject

Returns the value of attribute json.



13
14
15
# File 'lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb', line 13

def json
  @json
end

#scheduled_emailObject (readonly)

Returns the value of attribute scheduled_email.



12
13
14
# File 'lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb', line 12

def scheduled_email
  @scheduled_email
end

Instance Method Details

#export_optionsHash

Get export options settings

Returns:

  • (Hash)

    Export options settings



30
31
32
# File 'lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb', line 30

def export_options
  data['exportOptions']
end

#export_options=(new_export_options) ⇒ Hash

Set export options settings

Parameters:

  • new_export_options (Hash)

    New export options settings to be set

Returns:

  • (Hash)

    New export options settings



38
39
40
# File 'lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb', line 38

def export_options=(new_export_options)
  data['exportOptions'] = new_export_options
end

#formatsArray<String>

Get formats

Returns:

  • (Array<String>)

    List of selected formats



45
46
47
# File 'lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb', line 45

def formats
  data['formats']
end

#formats=(new_formats) ⇒ Array<String>

Set formats

Parameters:

  • new_formats (String | Array<String>)

    New list of selected formats to be set

Returns:

  • (Array<String>)

    New list of selected formats



53
54
55
# File 'lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb', line 53

def formats=(new_formats)
  data['formats'] = new_formats.is_a?(Array) ? new_formats : [new_formats]
end

#uriString

Get attachment URI

Returns:

  • (String)

    Attachment URI



60
61
62
# File 'lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb', line 60

def uri
  data['uri']
end