Class: Brainguy::Event

Inherits:
Struct
  • Object
show all
Defined in:
lib/brainguy/event.rb

Overview

An event. Bundles up a symbolic name, an originating object (source). and a list of event-defined args.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEvent

Returns a new instance of Event.

Parameters:

  • name (Symbol)

    the event name

  • source (Object)

    the originating object

  • args (Array)

    a list of event-specific arguments



8
9
10
11
# File 'lib/brainguy/event.rb', line 8

def initialize(*)
  super
  self.args ||= []
end

Instance Attribute Details

#argsObject

Returns the value of attribute args

Returns:

  • (Object)

    the current value of args



4
5
6
# File 'lib/brainguy/event.rb', line 4

def args
  @args
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/brainguy/event.rb', line 4

def name
  @name
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



4
5
6
# File 'lib/brainguy/event.rb', line 4

def source
  @source
end