Module: NurseAndrea::SelfFilter
- Defined in:
- lib/nurse_andrea/self_filter.rb
Constant Summary collapse
- PLATFORM_NAME_INDICATORS =
Hard-coded fallback retained ONLY for platform_self? — that check matches the SDK’s OWN Rails app name (process-level self- identification), which has no configured-URL equivalent. The R-14 anti-pattern (hard-coding customer URL substrings) does not apply here because the comparison target is the SDK’s own environment, not a user-supplied URL.
%w[nurseandrea nurse-andrea nurse_andrea].freeze
Class Method Summary collapse
Class Method Details
.host_matches?(*candidates) ⇒ Boolean
50 51 52 53 54 55 56 57 |
# File 'lib/nurse_andrea/self_filter.rb', line 50 def host_matches?(*candidates) indicator = configured_host_indicator return false if indicator.nil? || indicator.empty? candidates.compact.map(&:to_s).map(&:downcase).any? do |s| s.include?(indicator) end end |
.platform_self? ⇒ Boolean
41 42 43 44 |
# File 'lib/nurse_andrea/self_filter.rb', line 41 def platform_self? return @platform_self if defined?(@platform_self) @platform_self = compute_platform_self end |
.reset! ⇒ Object
46 47 48 |
# File 'lib/nurse_andrea/self_filter.rb', line 46 def reset! remove_instance_variable(:@platform_self) if defined?(@platform_self) end |