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
# 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)
  @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

#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

#serverObject (readonly)

Returns the value of attribute server.



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

def server
  @server
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

Instance Method Details

#report_embed_urlObject



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

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

#report_urlObject



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

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