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(tag:, record:, time: Time.now) ⇒ Event
constructor
A new instance of Event.
- #inspect ⇒ Object
Methods inherited from Base
#config_index, #config_param_types, #config_params, inherited, plugins, #shutdown
Constructor Details
#initialize(tag:, record:, time: Time.now) ⇒ Event
Returns a new instance of Event.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/fusuma/plugin/events/event.rb', line 18 def initialize(tag:, record:, time: Time.now) super() @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: #{record.class}, #{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
33 34 35 |
# File 'lib/fusuma/plugin/events/event.rb', line 33 def inspect "tag: #{tag}, record: #{record}" end |