Class: WebValve::FakeServiceConfig
- Inherits:
-
Object
- Object
- WebValve::FakeServiceConfig
- Defined in:
- lib/webvalve/fake_service_config.rb
Instance Attribute Summary collapse
-
#service_class_name ⇒ Object
readonly
Returns the value of attribute service_class_name.
Instance Method Summary collapse
- #explicitly_disabled? ⇒ Boolean
- #explicitly_enabled? ⇒ Boolean
-
#initialize(service_class_name:, url: nil) ⇒ FakeServiceConfig
constructor
A new instance of FakeServiceConfig.
- #service_url ⇒ Object
Constructor Details
#initialize(service_class_name:, url: nil) ⇒ FakeServiceConfig
Returns a new instance of FakeServiceConfig.
5 6 7 8 |
# File 'lib/webvalve/fake_service_config.rb', line 5 def initialize(service_class_name:, url: nil) @service_class_name = service_class_name @custom_service_url = url end |
Instance Attribute Details
#service_class_name ⇒ Object (readonly)
Returns the value of attribute service_class_name.
3 4 5 |
# File 'lib/webvalve/fake_service_config.rb', line 3 def service_class_name @service_class_name end |
Instance Method Details
#explicitly_disabled? ⇒ Boolean
14 15 16 |
# File 'lib/webvalve/fake_service_config.rb', line 14 def explicitly_disabled? value_from_env.present? && WebValve::DISABLED_VALUES.include?(value_from_env.to_s) end |
#explicitly_enabled? ⇒ Boolean
10 11 12 |
# File 'lib/webvalve/fake_service_config.rb', line 10 def explicitly_enabled? value_from_env.present? && WebValve::ENABLED_VALUES.include?(value_from_env.to_s) end |
#service_url ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/webvalve/fake_service_config.rb', line 18 def service_url @service_url ||= begin url = custom_service_url || default_service_url raise if url.blank? strip_basic_auth url end end |