Class: Canis::ActionEvent

Inherits:
Struct
  • Object
show all
Defined in:
lib/canis/core/include/ractionevent.rb

Overview

source - as always is the object whose event has been fired id - event identifier (seems redundant since we bind events often separately. event - is :PRESS action_command - command string associated with event (such as title of button that changed

Direct Known Subclasses

TextActionEvent

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#action_commandObject

Returns the value of attribute action_command

Returns:

  • (Object)

    the current value of action_command



20
21
22
# File 'lib/canis/core/include/ractionevent.rb', line 20

def action_command
  @action_command
end

#eventObject

Returns the value of attribute event

Returns:

  • (Object)

    the current value of event



20
21
22
# File 'lib/canis/core/include/ractionevent.rb', line 20

def event
  @event
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



20
21
22
# File 'lib/canis/core/include/ractionevent.rb', line 20

def source
  @source
end

Instance Method Details

#getvalueObject

This is similar to text and can often be just an alias. However, i am putting this for backward compatibility with programs that received the object and called it’s getvalue. It is better to use text.

Returns:

  • text associated with source (label of button)



33
34
35
# File 'lib/canis/core/include/ractionevent.rb', line 33

def getvalue
  source.getvalue
end

#textObject

This should always return the most relevant text associated with this object so the user does not have to go through the source object’s documentation. It should be a user-friendly string

Returns:

  • text associated with source (label of button)



25
26
27
# File 'lib/canis/core/include/ractionevent.rb', line 25

def text
  source.text
end