Class: Nquery::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/nquery/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



13
14
15
16
17
18
19
20
21
22
# File 'lib/nquery/configuration.rb', line 13

def initialize
  @authentication_mode = :standalone
  @current_user_method = :current_nquery_user
  @data_sources = { main: :rails }
  @query_timeout = 15
  @query_row_limit = 10_000
  @embed_secret = nil
  @authenticate_with = nil
  @resolve_nquery_user = nil
end

Instance Attribute Details

#authentication_modeObject

Returns the value of attribute authentication_mode.



5
6
7
# File 'lib/nquery/configuration.rb', line 5

def authentication_mode
  @authentication_mode
end

#current_user_methodObject

Returns the value of attribute current_user_method.



6
7
8
# File 'lib/nquery/configuration.rb', line 6

def current_user_method
  @current_user_method
end

#data_sourcesObject

Returns the value of attribute data_sources.



8
9
10
# File 'lib/nquery/configuration.rb', line 8

def data_sources
  @data_sources
end

#embed_secretObject

Returns the value of attribute embed_secret.



11
12
13
# File 'lib/nquery/configuration.rb', line 11

def embed_secret
  @embed_secret
end

#parent_controllerObject

Returns the value of attribute parent_controller.



7
8
9
# File 'lib/nquery/configuration.rb', line 7

def parent_controller
  @parent_controller
end

#query_row_limitObject

Returns the value of attribute query_row_limit.



10
11
12
# File 'lib/nquery/configuration.rb', line 10

def query_row_limit
  @query_row_limit
end

#query_timeoutObject

Returns the value of attribute query_timeout.



9
10
11
# File 'lib/nquery/configuration.rb', line 9

def query_timeout
  @query_timeout
end

Instance Method Details

#authenticateObject



28
29
30
# File 'lib/nquery/configuration.rb', line 28

def authenticate
  @authenticate_with
end

#authenticate_with(&block) ⇒ Object



24
25
26
# File 'lib/nquery/configuration.rb', line 24

def authenticate_with(&block)
  @authenticate_with = block
end

#embed_signing_keyObject



40
41
42
# File 'lib/nquery/configuration.rb', line 40

def embed_signing_key
  embed_secret || Rails.application.secret_key_base
end

#resolve_nquery_user(&block) ⇒ Object



32
33
34
# File 'lib/nquery/configuration.rb', line 32

def resolve_nquery_user(&block)
  @resolve_nquery_user = block
end

#resolve_userObject



36
37
38
# File 'lib/nquery/configuration.rb', line 36

def resolve_user
  @resolve_nquery_user
end