Class: Hubbado::Log::Logger::Substitute::Entry
- Inherits:
-
Data
- Object
- Data
- Hubbado::Log::Logger::Substitute::Entry
- Defined in:
- lib/hubbado/log/logger/substitute.rb
Overview
One line, as the logger read it rather than as the call site typed it.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#at?(name) ⇒ Boolean
As a symbol, because #log takes a String as readily.
-
#says?(pattern) ⇒ Boolean
A String names the line in full; a Regexp names enough of it to tell it from the others, without writing a record id into the spec.
-
#tagged?(names) ⇒ Boolean
Every tag the line carries, and no others.
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data
8 9 10 |
# File 'lib/hubbado/log/logger/substitute.rb', line 8 def data @data end |
#message ⇒ Object (readonly)
Returns the value of attribute message
8 9 10 |
# File 'lib/hubbado/log/logger/substitute.rb', line 8 def @message end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
8 9 10 |
# File 'lib/hubbado/log/logger/substitute.rb', line 8 def severity @severity end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags
8 9 10 |
# File 'lib/hubbado/log/logger/substitute.rb', line 8 def @tags end |
Instance Method Details
#at?(name) ⇒ Boolean
As a symbol, because #log takes a String as readily.
10 |
# File 'lib/hubbado/log/logger/substitute.rb', line 10 def at?(name) = severity == name.to_s.to_sym |
#says?(pattern) ⇒ Boolean
A String names the line in full; a Regexp names enough of it to tell it from the others, without writing a record id into the spec.
14 15 16 17 18 |
# File 'lib/hubbado/log/logger/substitute.rb', line 14 def says?(pattern) return pattern.match?(.to_s) if pattern.is_a?(Regexp) == pattern end |
#tagged?(names) ⇒ Boolean
Every tag the line carries, and no others. Order is not compared: a call site writes them in whatever order reads well, and the allow-list never sees one either.
22 |
# File 'lib/hubbado/log/logger/substitute.rb', line 22 def tagged?(names) = .uniq.sort == names.uniq.sort |