Class: Blocks::Sdk::Configuration
- Inherits:
-
Object
- Object
- Blocks::Sdk::Configuration
- Defined in:
- lib/blocks/sdk/configuration.rb
Overview
Configuration for Blocks SDK
Instance Attribute Summary collapse
-
#cache_enabled ⇒ Object
Returns the value of attribute cache_enabled.
-
#default_module_name ⇒ Object
Returns the value of attribute default_module_name.
-
#install_i18n_backend ⇒ Object
Returns the value of attribute install_i18n_backend.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#translation_languages ⇒ Object
Returns the value of attribute translation_languages.
-
#translation_modules ⇒ Object
Returns the value of attribute translation_modules.
-
#uilm_base_url ⇒ Object
Returns the value of attribute uilm_base_url.
-
#uilm_project_key ⇒ Object
Returns the value of attribute uilm_project_key.
-
#webhook_path_prefix ⇒ Object
Returns the value of attribute webhook_path_prefix.
-
#webhook_secret ⇒ Object
Returns the value of attribute webhook_secret.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/blocks/sdk/configuration.rb', line 11 def initialize @uilm_base_url = ENV.fetch("UILM_BASE_URL", nil) @uilm_project_key = ENV.fetch("UILM_PROJECT_KEY", nil) @webhook_secret = ENV.fetch("BLOCKS_WEBHOOK_SECRET", nil) @webhook_path_prefix = "/blocks/webhooks" @cache_enabled = true @logger = nil @install_i18n_backend = false @default_module_name = ENV.fetch("BLOCKS_DEFAULT_MODULE_NAME", nil) @translation_modules = nil @translation_languages = nil end |
Instance Attribute Details
#cache_enabled ⇒ Object
Returns the value of attribute cache_enabled.
7 8 9 |
# File 'lib/blocks/sdk/configuration.rb', line 7 def cache_enabled @cache_enabled end |
#default_module_name ⇒ Object
Returns the value of attribute default_module_name.
8 9 10 |
# File 'lib/blocks/sdk/configuration.rb', line 8 def default_module_name @default_module_name end |
#install_i18n_backend ⇒ Object
Returns the value of attribute install_i18n_backend.
8 9 10 |
# File 'lib/blocks/sdk/configuration.rb', line 8 def install_i18n_backend @install_i18n_backend end |
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/blocks/sdk/configuration.rb', line 7 def logger @logger end |
#translation_languages ⇒ Object
Returns the value of attribute translation_languages.
9 10 11 |
# File 'lib/blocks/sdk/configuration.rb', line 9 def translation_languages @translation_languages end |
#translation_modules ⇒ Object
Returns the value of attribute translation_modules.
9 10 11 |
# File 'lib/blocks/sdk/configuration.rb', line 9 def translation_modules @translation_modules end |
#uilm_base_url ⇒ Object
Returns the value of attribute uilm_base_url.
5 6 7 |
# File 'lib/blocks/sdk/configuration.rb', line 5 def uilm_base_url @uilm_base_url end |
#uilm_project_key ⇒ Object
Returns the value of attribute uilm_project_key.
5 6 7 |
# File 'lib/blocks/sdk/configuration.rb', line 5 def uilm_project_key @uilm_project_key end |
#webhook_path_prefix ⇒ Object
Returns the value of attribute webhook_path_prefix.
6 7 8 |
# File 'lib/blocks/sdk/configuration.rb', line 6 def webhook_path_prefix @webhook_path_prefix end |
#webhook_secret ⇒ Object
Returns the value of attribute webhook_secret.
6 7 8 |
# File 'lib/blocks/sdk/configuration.rb', line 6 def webhook_secret @webhook_secret end |
Instance Method Details
#to_h ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/blocks/sdk/configuration.rb', line 24 def to_h { uilm_base_url: @uilm_base_url, uilm_project_key: @uilm_project_key, webhook_secret: @webhook_secret, webhook_path_prefix: @webhook_path_prefix, cache_enabled: @cache_enabled, install_i18n_backend: @install_i18n_backend, default_module_name: @default_module_name } end |