struct Opal::Asciicast::Event

Overview

Represents an individual event in an Asciinema v2 stream. Each event is formatted as a 3-element JSON array: [time, type, data]

Defined in:

opal/asciicast/event.cr

Constructors

Instance Method Summary

Constructor Detail

def self.from_json(json_str : String) : Event #

[View source]
def self.from_json_array(arr : Array(JSON::Any)) : Event #

[View source]
def self.input(time : Float64, data : String) : Event #

Convenience constructor for input events


[View source]
def self.marker(time : Float64, label : String) : Event #

Convenience constructor for marker events


[View source]
def self.new(time : Float64, type : String, data : String) #

[View source]
def self.output(time : Float64, data : String) : Event #

Convenience constructor for output events


[View source]

Instance Method Detail

def data : String #

[View source]
def input? : Bool #

[View source]
def marker? : Bool #

[View source]
def output? : Bool #

[View source]
def time : Float64 #

[View source]
def to_json(json : JSON::Builder) : Nil #

[View source]
def to_s(io : IO) : Nil #
Description copied from struct Struct

Same as #inspect(io).


[View source]
def type : String #

[View source]