Class: Rails::Contact::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rails/contact/configuration.rb', line 9

def initialize
  @contact_class_name = "Rails::Contact::Contact"
  @elasticsearch_url = ENV.fetch("ELASTICSEARCH_URL", "http://127.0.0.1:9200")
  @search_backend = :elasticsearch
  @google_sync_enabled = false
  @google_max_contacts = 25_000
  @rolling_window_sort = :updated_at
  @google_client_id = ENV["GOOGLE_CLIENT_ID"]
  @google_client_secret = ENV["GOOGLE_CLIENT_SECRET"]
  @google_redirect_uri = ENV["GOOGLE_REDIRECT_URI"]
  @google_token_path = ENV.fetch("RAILS_CONTACT_GOOGLE_TOKEN_PATH", "tmp/rails_contact_google_token.json")
  @reset_index_on_boot = false
  @default_per_page = 25
end

Instance Attribute Details

#contact_class_nameObject

Returns the value of attribute contact_class_name.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def contact_class_name
  @contact_class_name
end

#default_per_pageObject

Returns the value of attribute default_per_page.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def default_per_page
  @default_per_page
end

#elasticsearch_urlObject

Returns the value of attribute elasticsearch_url.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def elasticsearch_url
  @elasticsearch_url
end

#google_client_idObject

Returns the value of attribute google_client_id.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def google_client_id
  @google_client_id
end

#google_client_secretObject

Returns the value of attribute google_client_secret.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def google_client_secret
  @google_client_secret
end

#google_max_contactsObject

Returns the value of attribute google_max_contacts.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def google_max_contacts
  @google_max_contacts
end

#google_redirect_uriObject

Returns the value of attribute google_redirect_uri.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def google_redirect_uri
  @google_redirect_uri
end

#google_sync_enabledObject

Returns the value of attribute google_sync_enabled.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def google_sync_enabled
  @google_sync_enabled
end

#google_token_pathObject

Returns the value of attribute google_token_path.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def google_token_path
  @google_token_path
end

#reset_index_on_bootObject

Returns the value of attribute reset_index_on_boot.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def reset_index_on_boot
  @reset_index_on_boot
end

#rolling_window_sortObject

Returns the value of attribute rolling_window_sort.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def rolling_window_sort
  @rolling_window_sort
end

#search_backendObject

Returns the value of attribute search_backend.



4
5
6
# File 'lib/rails/contact/configuration.rb', line 4

def search_backend
  @search_backend
end