Class: LogStruct::ConfigStruct::FilterMatcher

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/log_struct/config_struct/filters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(callable:, label:) ⇒ void

Parameters:

  • callable (T.proc.params(key: String, value: T.untyped).returns(T::Boolean))
  • label (String)


# File ''

const :callable, T.proc.params(key: String, value: T.untyped).returns(T::Boolean)
const :label, String

Instance Attribute Details

#callableT.proc.params(key: String, value: T.untyped).returns(T::Boolean) (readonly)

Returns the value of prop callable.

Returns:

  • (T.proc.params(key: String, value: T.untyped).returns(T::Boolean))


# File ''

const :callable, T.proc.params(key: String, value: T.untyped).returns(T::Boolean)

#labelString (readonly)

Returns the value of prop label.

Returns:

  • (String)


# File ''

const :label, String

Instance Method Details

#matches?(key, value) ⇒ Boolean

Parameters:

  • key (String)
  • value (T.untyped)

Returns:

  • (Boolean)


13
14
15
# File 'lib/log_struct/config_struct/filters.rb', line 13

def matches?(key, value)
  callable.call(key, value)
end