Class: EventMeter::WriteResult
- Inherits:
-
Object
- Object
- EventMeter::WriteResult
- Defined in:
- lib/event_meter/write_result.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
Class Method Summary collapse
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(payload:, error:) ⇒ WriteResult
constructor
A new instance of WriteResult.
- #recorded? ⇒ Boolean
Constructor Details
#initialize(payload:, error:) ⇒ WriteResult
Returns a new instance of WriteResult.
13 14 15 16 |
# File 'lib/event_meter/write_result.rb', line 13 def initialize(payload:, error:) @payload = payload @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
3 4 5 |
# File 'lib/event_meter/write_result.rb', line 3 def error @error end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
3 4 5 |
# File 'lib/event_meter/write_result.rb', line 3 def payload @payload end |
Class Method Details
.failed(payload:, error:) ⇒ Object
9 10 11 |
# File 'lib/event_meter/write_result.rb', line 9 def self.failed(payload:, error:) new(payload: payload, error: error) end |
.recorded(payload) ⇒ Object
5 6 7 |
# File 'lib/event_meter/write_result.rb', line 5 def self.recorded(payload) new(payload: payload, error: nil) end |
Instance Method Details
#error? ⇒ Boolean
22 23 24 |
# File 'lib/event_meter/write_result.rb', line 22 def error? !recorded? end |
#recorded? ⇒ Boolean
18 19 20 |
# File 'lib/event_meter/write_result.rb', line 18 def recorded? error.nil? end |