Class: Agent::SessionContext::InjectedContext
- Inherits:
-
Data
- Object
- Data
- Agent::SessionContext::InjectedContext
- Defined in:
- lib/agent/session_context/injected_context.rb
Instance Attribute Summary collapse
-
#bytes ⇒ Object
readonly
Returns the value of attribute bytes.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#occurrences ⇒ Object
readonly
Returns the value of attribute occurrences.
-
#source_refs ⇒ Object
readonly
Returns the value of attribute source_refs.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(kind:, bytes:, occurrences:, source_refs:, text: nil) ⇒ InjectedContext
constructor
A new instance of InjectedContext.
Constructor Details
#initialize(kind:, bytes:, occurrences:, source_refs:, text: nil) ⇒ InjectedContext
Returns a new instance of InjectedContext.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/agent/session_context/injected_context.rb', line 6 def initialize(kind:, bytes:, occurrences:, source_refs:, text: nil) normalized_kind = normalize_symbol(kind, :kind) normalized_bytes = normalize_nonnegative_integer(bytes, :bytes) normalized_occurrences = normalize_positive_integer(occurrences, :occurrences) normalized_source_refs = normalize_source_refs(source_refs) normalized_text = normalize_optional_string(text, :text) validate_consistency!( bytes: normalized_bytes, occurrences: normalized_occurrences, source_refs: normalized_source_refs, text: normalized_text ) super( kind: normalized_kind, bytes: normalized_bytes, occurrences: normalized_occurrences, source_refs: normalized_source_refs, text: normalized_text ) end |
Instance Attribute Details
#bytes ⇒ Object (readonly)
Returns the value of attribute bytes
5 6 7 |
# File 'lib/agent/session_context/injected_context.rb', line 5 def bytes @bytes end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
5 6 7 |
# File 'lib/agent/session_context/injected_context.rb', line 5 def kind @kind end |
#occurrences ⇒ Object (readonly)
Returns the value of attribute occurrences
5 6 7 |
# File 'lib/agent/session_context/injected_context.rb', line 5 def occurrences @occurrences end |
#source_refs ⇒ Object (readonly)
Returns the value of attribute source_refs
5 6 7 |
# File 'lib/agent/session_context/injected_context.rb', line 5 def source_refs @source_refs end |
#text ⇒ Object (readonly)
Returns the value of attribute text
5 6 7 |
# File 'lib/agent/session_context/injected_context.rb', line 5 def text @text end |