Class: TableauTrustedInterface::Report

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Report

Returns a new instance of Report.

Raises:



9
10
11
12
13
14
15
16
17
18
# File 'lib/tableau_trusted_interface/report.rb', line 9

def initialize(options = {})
  @path = options.fetch(:path, nil)
  @embed_params = parse_embed_params(options.fetch(:embed_params, {}))
  @user = options.fetch(:user, TableauTrustedInterface.config.default_tableau_user)
  @auth_server = options.fetch(:auth_server, (TableauTrustedInterface.config.default_tableau_auth_server || options.fetch(:server, TableauTrustedInterface.config.default_tableau_server)))
  @view_server = options.fetch(:view_server, (TableauTrustedInterface.config.default_tableau_view_server || options.fetch(:server, TableauTrustedInterface.config.default_tableau_server)))

  @ticket = generate_ticket
  raise TicketDenied, 'Check Tableau IP white-listing or user access' if @ticket == '-1'
end

Instance Attribute Details

#auth_serverObject (readonly)

Returns the value of attribute auth_server.



6
7
8
# File 'lib/tableau_trusted_interface/report.rb', line 6

def auth_server
  @auth_server
end

#embed_paramsObject

Returns the value of attribute embed_params.



7
8
9
# File 'lib/tableau_trusted_interface/report.rb', line 7

def embed_params
  @embed_params
end

#pathObject

Returns the value of attribute path.



7
8
9
# File 'lib/tableau_trusted_interface/report.rb', line 7

def path
  @path
end

#ticketObject (readonly)

Returns the value of attribute ticket.



6
7
8
# File 'lib/tableau_trusted_interface/report.rb', line 6

def ticket
  @ticket
end

#userObject (readonly)

Returns the value of attribute user.



6
7
8
# File 'lib/tableau_trusted_interface/report.rb', line 6

def user
  @user
end

#view_serverObject (readonly)

Returns the value of attribute view_server.



6
7
8
# File 'lib/tableau_trusted_interface/report.rb', line 6

def view_server
  @view_server
end

Instance Method Details

#report_embed_urlObject



24
25
26
# File 'lib/tableau_trusted_interface/report.rb', line 24

def report_embed_url
  report.expand(query: embed_params).to_s
end

#report_urlObject



20
21
22
# File 'lib/tableau_trusted_interface/report.rb', line 20

def report_url
  report.expand(query: nil).to_s
end