Class: Fusuma::Plugin::Events::Event
- Defined in:
- lib/fusuma/plugin/events/event.rb
Overview
Event format
Instance Attribute Summary collapse
-
#record ⇒ Object
Returns the value of attribute record.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(time: Time.now, tag:, record:) ⇒ Event
constructor
A new instance of Event.
- #inspect ⇒ Object
Methods inherited from Base
#config_index, #config_param_types, #config_params, inherited, plugins
Constructor Details
#initialize(time: Time.now, tag:, record:) ⇒ Event
Returns a new instance of Event.
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fusuma/plugin/events/event.rb', line 18 def initialize(time: Time.now, tag:, record:) @time = time @tag = tag @record = case record when Records::Record record when String Records::TextRecord.new(record) else raise ArgumentError, '@record should be String or Record' end end |
Instance Attribute Details
#record ⇒ Object
Returns the value of attribute record.
13 14 15 |
# File 'lib/fusuma/plugin/events/event.rb', line 13 def record @record end |
#tag ⇒ Object
Returns the value of attribute tag.
13 14 15 |
# File 'lib/fusuma/plugin/events/event.rb', line 13 def tag @tag end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
12 13 14 |
# File 'lib/fusuma/plugin/events/event.rb', line 12 def time @time end |
Instance Method Details
#inspect ⇒ Object
32 33 34 |
# File 'lib/fusuma/plugin/events/event.rb', line 32 def inspect "time: #{time}, tag: #{tag}, record: #{record}" end |