Class: Umbra::EventHandler::ActionEvent

Inherits:
Struct
  • Object
show all
Defined in:
lib/umbra/eventhandler.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

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



162
163
164
# File 'lib/umbra/eventhandler.rb', line 162

def action_command
  @action_command
end

#eventObject

Returns the value of attribute event

Returns:

  • (Object)

    the current value of event



162
163
164
# File 'lib/umbra/eventhandler.rb', line 162

def event
  @event
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



162
163
164
# File 'lib/umbra/eventhandler.rb', line 162

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)



175
176
177
178
# File 'lib/umbra/eventhandler.rb', line 175

def getvalue
  raise "getvalue in eventhandler. remove if does not happen in 2018"
  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)



167
168
169
# File 'lib/umbra/eventhandler.rb', line 167

def text
  source.text
end