Class: QQQ::Event
- Inherits:
-
Object
- Object
- QQQ::Event
- Defined in:
- lib/qqq/events.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#recorded_at ⇒ Object
readonly
Returns the value of attribute recorded_at.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
- #for_humans ⇒ Object
-
#initialize(uuid:, message:, recorded_at:) ⇒ Event
constructor
A new instance of Event.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(uuid:, message:, recorded_at:) ⇒ Event
Returns a new instance of Event.
17 18 19 20 21 |
# File 'lib/qqq/events.rb', line 17 def initialize(uuid:, message:, recorded_at:) @uuid = uuid @recorded_at = recorded_at @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/qqq/events.rb', line 4 def @message end |
#recorded_at ⇒ Object (readonly)
Returns the value of attribute recorded_at.
4 5 6 |
# File 'lib/qqq/events.rb', line 4 def recorded_at @recorded_at end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
4 5 6 |
# File 'lib/qqq/events.rb', line 4 def uuid @uuid end |
Class Method Details
Instance Method Details
#as_json(options = {}) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/qqq/events.rb', line 27 def as_json(={}) { uuid: @uuid, message: @message, recorded_at: @recorded_at, } end |
#for_humans ⇒ Object
23 24 25 |
# File 'lib/qqq/events.rb', line 23 def for_humans "[#{@uuid}] [#{@recorded_at}] #{@message}" end |
#to_json(*options) ⇒ Object
34 35 36 |
# File 'lib/qqq/events.rb', line 34 def to_json(*) as_json(*).to_json(*) end |