Class: Tuile::Component::HasValue::ValueChangeEvent
- Inherits:
-
Data
- Object
- Data
- Tuile::Component::HasValue::ValueChangeEvent
- Includes:
- Event
- Defined in:
- lib/tuile/component/has_value.rb,
sig/tuile.rbs
Overview
What #on_value_change fires.
Instance Attribute Summary collapse
-
#from_user ⇒ Boolean
readonly
@return — what the writer declared; read it as #from_user?.
-
#source ⇒ Component
readonly
@return — the field whose value changed.
-
#value ⇒ Object
readonly
@return — the new value.
Instance Method Summary collapse
-
#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 #set_value;
falsefor every #value=.
Instance Attribute Details
#from_user ⇒ Boolean (readonly)
@return — what the writer declared; read it as #from_user?.
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.
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.
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=.
58 |
# File 'lib/tuile/component/has_value.rb', line 58 def from_user? = from_user |