Class: Fusuma::Plugin::Events::Event
- Defined in:
- lib/fusuma/plugin/events/event.rb
Overview
Event format
Instance Attribute Summary collapse
-
#record ⇒ Object
: Records::Record.
-
#tag ⇒ Object
: String.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(tag:, record:, time: Time.now) ⇒ Event
constructor
: (tag: String, record: String | Fusuma::Plugin::Events::Records::Record, ?time: Time | nil) -> void.
-
#inspect ⇒ Object
: () -> String.
Methods inherited from Base
#config_index, #config_param_types, #config_params, inherited, plugins, #shutdown
Constructor Details
#initialize(tag:, record:, time: Time.now) ⇒ Event
: (tag: String, record: String | Fusuma::Plugin::Events::Records::Record, ?time: Time | nil) -> void
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/fusuma/plugin/events/event.rb', line 20 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
: Records::Record
14 15 16 |
# File 'lib/fusuma/plugin/events/event.rb', line 14 def record @record end |
#tag ⇒ Object
: String
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
: () -> String
36 37 38 |
# File 'lib/fusuma/plugin/events/event.rb', line 36 def inspect "tag: #{@tag}, record: #{@record}" end |