Class: TableauRestApi::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/tableau_rest_api/util/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Config

Returns a new instance of Config.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tableau_rest_api/util/config.rb', line 5

def initialize(config={})
  @options = {
    host: ENV['TABLEAU_HOST'] || 'https://tableau.lvh.me',
    api_version: '2.6',
    base: 'api',
    auth_duration: ENV['TABLEAU_AUTH_TOKEN_DURATION'] || 4.hours,
    credentials: {
      credentials: { 
        name: ENV['TABLEAU_USERNAME'] || 'admin',
        password: ENV['TABLEAU_PASSWORD'] || 'admin',
        site: { contentUrl: "" }
      }
    }
  }
  @options = @options.merge(config)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/tableau_rest_api/util/config.rb', line 3

def options
  @options
end