struct Sepia::Event

Overview

Represents a file system event for a Sepia object.

Defined in:

sepia/watcher.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(type : EventType, object_class : String, object_id : String, path : String, object_info : PathResolver::ObjectInfo | Nil = nil) #

[View source]

Instance Method Detail

def object(klass : Class) : Object | Nil #

Load the actual Sepia object from this event

obj = event.object(MyDocument)
if obj
  puts "Loaded object: #{obj.class.name}"
end

[View source]
def object_class : String #

[View source]
def object_class=(object_class : String) #

[View source]
def object_id : String #

[View source]
def object_id=(object_id : String) #

[View source]
def object_info : PathResolver::ObjectInfo | Nil #

[View source]
def object_info=(object_info : PathResolver::ObjectInfo | Nil) #

[View source]
def object_info? : Sepia::PathResolver::ObjectInfo? #

Get the resolved object information for this event


[View source]
def path : String #

[View source]
def path=(path : String) #

[View source]
def timestamp : Time #

[View source]
def timestamp=(timestamp : Time) #

[View source]
def type : EventType #

[View source]
def type=(type : EventType) #

[View source]