Class: FeatureFlagMonitor::ConsulKey
- Inherits:
-
Object
- Object
- FeatureFlagMonitor::ConsulKey
- Defined in:
- lib/feature_flag_monitor/consul_key.rb
Class Method Summary collapse
Instance Method Summary collapse
- #for_domain ⇒ Object
-
#initialize(key_type, identifier) ⇒ ConsulKey
constructor
A new instance of ConsulKey.
- #to_key ⇒ Object
Constructor Details
#initialize(key_type, identifier) ⇒ ConsulKey
Returns a new instance of ConsulKey.
15 16 17 |
# File 'lib/feature_flag_monitor/consul_key.rb', line 15 def initialize(key_type, identifier) @key_parts = ['ffm', key_type, identifier] end |
Class Method Details
.by_cname(cname) ⇒ Object
7 8 9 |
# File 'lib/feature_flag_monitor/consul_key.rb', line 7 def self.by_cname(cname) self.new(:n, cname) end |
.by_id(id) ⇒ Object
3 4 5 |
# File 'lib/feature_flag_monitor/consul_key.rb', line 3 def self.by_id(id) self.new(:i, id) end |
.for_types ⇒ Object
11 12 13 |
# File 'lib/feature_flag_monitor/consul_key.rb', line 11 def self.for_types self.new(:m, 'types').to_key end |
Instance Method Details
#for_domain ⇒ Object
19 20 21 |
# File 'lib/feature_flag_monitor/consul_key.rb', line 19 def for_domain to_key end |
#to_key ⇒ Object
23 24 25 |
# File 'lib/feature_flag_monitor/consul_key.rb', line 23 def to_key @key_parts.join('/') << '?stale' end |