Class: Yoda::Store::FileTree::EventSet

Inherits:
Object
  • Object
show all
Defined in:
lib/yoda/store/file_tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEventSet

Returns a new instance of EventSet.



114
115
116
# File 'lib/yoda/store/file_tree.rb', line 114

def initialize
  @listeners = []
end

Instance Attribute Details

#listenersArray<#call> (readonly)

Returns:

  • (Array<#call>)


112
113
114
# File 'lib/yoda/store/file_tree.rb', line 112

def listeners
  @listeners
end

Instance Method Details

#listen(&listener) ⇒ Object

Parameters:

  • listener (#call)


119
120
121
# File 'lib/yoda/store/file_tree.rb', line 119

def listen(&listener)
  listeners << listener
end

#notify(**kwargs) ⇒ Object



123
124
125
126
127
# File 'lib/yoda/store/file_tree.rb', line 123

def notify(**kwargs)
  listeners.each do |listener|
    listener.call(**kwargs)
  end
end