Module: BrandUtil
- Defined in:
- lib/wingify/utils/brand_util.rb
Overview
BrandUtil provides pure, side-effect-free selectors for brand-specific constants. Every method takes an explicit is_via_vwo boolean so it can be used both at init time (reading BrandContext) and in tests (passed directly).
Class Method Summary collapse
-
.get_brand_name(is_via_vwo) ⇒ Object
Returns the human-readable brand display name used in messages.
-
.get_events_hostname(is_via_vwo) ⇒ Object
Returns the hostname used for ALL COLLECT / EVENT calls (track user, track goal, set attribute, batch events, usage stats, debugger events, SDK init event).
-
.get_log_prefix(is_via_vwo) ⇒ Object
Returns the log prefix shown in every log line.
-
.get_sdk_name(is_via_vwo) ⇒ Object
Returns the gem/SDK name sent in network requests.
-
.get_settings_hostname(is_via_vwo) ⇒ Object
Returns the hostname used to FETCH SETTINGS.
Class Method Details
.get_brand_name(is_via_vwo) ⇒ Object
Returns the human-readable brand display name used in messages. Values: ‘VWO’ or ‘Wingify’
50 51 52 |
# File 'lib/wingify/utils/brand_util.rb', line 50 def self.get_brand_name(is_via_vwo) is_via_vwo ? Constants::VWO_BRAND_DISPLAY_NAME : Constants::WINGIFY_BRAND_DISPLAY_NAME end |
.get_events_hostname(is_via_vwo) ⇒ Object
Returns the hostname used for ALL COLLECT / EVENT calls (track user, track goal, set attribute, batch events, usage stats, debugger events, SDK init event). VWO: dev.visualwebsiteoptimizer.com Wingify: collect.wingify.net
38 39 40 |
# File 'lib/wingify/utils/brand_util.rb', line 38 def self.get_events_hostname(is_via_vwo) is_via_vwo ? Constants::VWO_HOST_NAME : Constants::WINGIFY_COLLECTION_HOST_NAME end |
.get_log_prefix(is_via_vwo) ⇒ Object
Returns the log prefix shown in every log line. Values: ‘VWO-SDK’ or ‘Wingify-SDK’
44 45 46 |
# File 'lib/wingify/utils/brand_util.rb', line 44 def self.get_log_prefix(is_via_vwo) is_via_vwo ? Constants::VWO_LOG_PREFIX : Constants::WINGIFY_LOG_PREFIX end |
.get_sdk_name(is_via_vwo) ⇒ Object
Returns the gem/SDK name sent in network requests. Values: ‘vwo-fme-ruby-sdk’ or ‘wingify-fme-ruby-sdk’
23 24 25 |
# File 'lib/wingify/utils/brand_util.rb', line 23 def self.get_sdk_name(is_via_vwo) is_via_vwo ? Constants::VWO_SDK_NAME : Constants::WINGIFY_SDK_NAME end |
.get_settings_hostname(is_via_vwo) ⇒ Object
Returns the hostname used to FETCH SETTINGS. VWO: dev.visualwebsiteoptimizer.com Wingify: edge.wingify.net
30 31 32 |
# File 'lib/wingify/utils/brand_util.rb', line 30 def self.get_settings_hostname(is_via_vwo) is_via_vwo ? Constants::VWO_HOST_NAME : Constants::WINGIFY_SETTINGS_HOST_NAME end |