Class: Koz::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/koz/event.rb,
lib/koz/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEvent

Returns a new instance of Event.



4
5
6
7
8
9
10
# File 'lib/koz/event.rb', line 4

def initialize
  @target = nil
  @data = {}
  @type = nil
  @box = Poti
  @path = []
end

Instance Attribute Details

#boxObject

Returns the value of attribute box.



3
4
5
# File 'lib/koz/event.rb', line 3

def box
  @box
end

#configObject

Returns the value of attribute config.



107
108
109
# File 'lib/koz/config.rb', line 107

def config
  @config
end

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/koz/event.rb', line 3

def data
  @data
end

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/koz/event.rb', line 3

def path
  @path
end

#stoppedObject

Returns the value of attribute stopped.



3
4
5
# File 'lib/koz/event.rb', line 3

def stopped
  @stopped
end

#targetObject

Returns the value of attribute target.



3
4
5
# File 'lib/koz/event.rb', line 3

def target
  @target
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/koz/event.rb', line 3

def type
  @type
end

Instance Method Details

#>>(photon) ⇒ Object



20
21
22
# File 'lib/koz/event.rb', line 20

def >> photon
  photon.call self
end

#dupObject



12
13
14
15
16
17
18
# File 'lib/koz/event.rb', line 12

def dup
  ev = self.class.new
  ev.target = @target
  ev.data = @data.dup
  ev.type = @type.dup
  ev
end

#to_boxObject



24
25
26
# File 'lib/koz/event.rb', line 24

def to_box
  @box.new(self)
end