Sha256: 9d4cdf64cbf72edd7fccff04fbcbefb87736fee5cc2ea212dc05db42f25d5a70
Contents?: true
Size: 982 Bytes
Versions: 12
Compression:
Stored size: 982 Bytes
Contents
# frozen_string_literal: true require_relative '../base' require_relative './records/record' require_relative './records/text_record' module Fusuma module Plugin module Events # Event format class Event < Base attr_reader :time attr_accessor :tag, :record # @param time [Time] # @param tag [Tag] # @param record [String, Record] 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' end end def inspect "time: #{time}, tag: #{tag}, record: #{record}" end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems