Class: Tuile::Component::HasValue::ValueChangeEvent

Inherits:
Data
  • Object
show all
Includes:
Event
Defined in:
lib/tuile/component/has_value.rb,
sig/tuile.rbs

Overview

What #on_value_change fires.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#from_user ⇒ Boolean (readonly)

@return — what the writer declared; read it as #from_user?.

Returns:

  • (Boolean)


52
53
54
55
56
57
58
59
# File 'lib/tuile/component/has_value.rb', line 52

ValueChangeEvent = Data.define(:source, :value, :from_user) do
  include Tuile::Event

  # @return [Boolean] whether the change came from the user — typing, a
  #   paste, a click, a key — or from an app writing on the user's
  #   behalf through {HasValue#set_value}; `false` for every {HasValue#value=}.
  def from_user? = from_user
end

#source ⇒ Component (readonly)

@return — the field whose value changed.

Returns:



52
53
54
55
56
57
58
59
# File 'lib/tuile/component/has_value.rb', line 52

ValueChangeEvent = Data.define(:source, :value, :from_user) do
  include Tuile::Event

  # @return [Boolean] whether the change came from the user — typing, a
  #   paste, a click, a key — or from an app writing on the user's
  #   behalf through {HasValue#set_value}; `false` for every {HasValue#value=}.
  def from_user? = from_user
end

#value ⇒ Object (readonly)

@return — the new value.

Returns:

  • (Object)


52
53
54
55
56
57
58
59
# File 'lib/tuile/component/has_value.rb', line 52

ValueChangeEvent = Data.define(:source, :value, :from_user) do
  include Tuile::Event

  # @return [Boolean] whether the change came from the user — typing, a
  #   paste, a click, a key — or from an app writing on the user's
  #   behalf through {HasValue#set_value}; `false` for every {HasValue#value=}.
  def from_user? = from_user
end

Instance Method Details

#from_user? ⇒ Boolean

@return — whether the change came from the user — typing, a paste, a click, a key — or from an app writing on the user's behalf through Tuile::Component::HasValue#set_value; false for every Tuile::Component::HasValue#value=.

Returns:

  • (Boolean)


58
# File 'lib/tuile/component/has_value.rb', line 58

def from_user? = from_user