Class: Trainspotter::Ingest::Line
- Inherits:
-
Object
- Object
- Trainspotter::Ingest::Line
- Defined in:
- app/jobs/trainspotter/ingest/line.rb
Constant Summary collapse
- TYPES =
i[request_start processing params sql render request_end other].freeze
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #duration_ms ⇒ Object
-
#initialize(raw:, type: :other, timestamp: nil, metadata: {}) ⇒ Line
constructor
A new instance of Line.
- #params? ⇒ Boolean
- #processing? ⇒ Boolean
- #render? ⇒ Boolean
- #request_end? ⇒ Boolean
- #request_start? ⇒ Boolean
- #sql? ⇒ Boolean
Constructor Details
#initialize(raw:, type: :other, timestamp: nil, metadata: {}) ⇒ Line
Returns a new instance of Line.
8 9 10 11 12 13 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 8 def initialize(raw:, type: :other, timestamp: nil, metadata: {}) @raw = raw @type = type = = end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
6 7 8 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 6 def end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
6 7 8 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 6 def raw @raw end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
6 7 8 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 6 def end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 6 def type @type end |
Instance Method Details
#duration_ms ⇒ Object
39 40 41 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 39 def duration_ms [:duration_ms] end |
#params? ⇒ Boolean
35 36 37 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 35 def params? type == :params end |
#processing? ⇒ Boolean
31 32 33 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 31 def processing? type == :processing end |
#render? ⇒ Boolean
19 20 21 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 19 def render? type == :render end |
#request_end? ⇒ Boolean
27 28 29 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 27 def request_end? type == :request_end end |
#request_start? ⇒ Boolean
23 24 25 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 23 def request_start? type == :request_start end |
#sql? ⇒ Boolean
15 16 17 |
# File 'app/jobs/trainspotter/ingest/line.rb', line 15 def sql? type == :sql end |