Class: Moon::Text::StringChangedEvent

Inherits:
Event show all
Defined in:
lib/moon/packages/render_primitives/ui/text.rb

Overview

A StringChangedEvent is triggered when the Text#string changes, note this event will trigger even if the String's value is the same.

Instance Attribute Summary collapse

Attributes inherited from Event

#id, #type

Instance Method Summary collapse

Methods inherited from Event

make_filter

Constructor Details

#initialize(old, string) ⇒ StringChangedEvent

Returns a new instance of StringChangedEvent.

Parameters:


18
19
20
21
22
# File 'lib/moon/packages/render_primitives/ui/text.rb', line 18

def initialize(old, string)
  @old = old
  @string = string
  super :text_string_changed
end

Instance Attribute Details

#oldString

Returns original value of the string.

Returns:

  • (String)

    original value of the string


11
12
13
# File 'lib/moon/packages/render_primitives/ui/text.rb', line 11

def old
  @old
end

#stringString

Returns current value of the string.

Returns:

  • (String)

    current value of the string


14
15
16
# File 'lib/moon/packages/render_primitives/ui/text.rb', line 14

def string
  @string
end