Class: Continuum::Report

Inherits:
Object
  • Object
show all
Defined in:
src/lib/continuum/report.rb

Overview

This class encapsulates all the metadata relevant to an AMP report.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report_id, name) ⇒ Report

Returns a new instance of Report.

Parameters:

  • report_id (Integer, nil)

    The ID of the report

  • name (String, nil)

    The name of this report



20
21
22
23
# File 'src/lib/continuum/report.rb', line 20

def initialize(report_id, name)
  @id = report_id
  @name = name
end

Instance Attribute Details

#idInteger?

Gets the ID of this report.

Returns:

  • (Integer, nil)

    The ID of this report in AMP; Nil if this report does not yet exist in AMP



11
12
13
# File 'src/lib/continuum/report.rb', line 11

def id
  @id
end

#nameString

Gets the name of this report.

Returns:

  • (String)

    The name of this report



16
17
18
# File 'src/lib/continuum/report.rb', line 16

def name
  @name
end

Instance Method Details

#get_amp_urlString

Gets the URL to this report in AMP.

Returns:

  • (String)

    The URL to this report in AMP; None if this report does not yet exist in AMP



28
29
30
31
# File 'src/lib/continuum/report.rb', line 28

def get_amp_url
  return nil unless @id
  URI.join(Continuum.configuration.amp_instance_url, "/public/reporting/view_report.php?report_id=#{@id}").to_s
end