Class: DebugBundle::RemoteConfig::Directive

Inherits:
Struct
  • Object
show all
Defined in:
lib/debugbundle/remote_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#environmentObject

Returns the value of attribute environment

Returns:

  • (Object)

    the current value of environment



17
18
19
# File 'lib/debugbundle/remote_config.rb', line 17

def environment
  @environment
end

#expires_atObject

Returns the value of attribute expires_at

Returns:

  • (Object)

    the current value of expires_at



17
18
19
# File 'lib/debugbundle/remote_config.rb', line 17

def expires_at
  @expires_at
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



17
18
19
# File 'lib/debugbundle/remote_config.rb', line 17

def id
  @id
end

#label_patternObject

Returns the value of attribute label_pattern

Returns:

  • (Object)

    the current value of label_pattern



17
18
19
# File 'lib/debugbundle/remote_config.rb', line 17

def label_pattern
  @label_pattern
end

#serviceObject

Returns the value of attribute service

Returns:

  • (Object)

    the current value of service



17
18
19
# File 'lib/debugbundle/remote_config.rb', line 17

def service
  @service
end

Instance Method Details

#active?(label:, service:, environment:, now:) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
# File 'lib/debugbundle/remote_config.rb', line 18

def active?(label:, service:, environment:, now:)
  return false if expires_at <= now
  return false unless match_scope?(self.service, service)
  return false unless match_scope?(self.environment, environment)

  match_label?(label_pattern, label)
end