class Sirens::InputText

Public Instance Methods

create_view() click to toggle source

Returns a TextView.

# File lib/components/widgets/input_text.rb, line 6
def create_view()
    InputTextView.new
end
default_model() click to toggle source

Returns a default model if none is given during the initialization of this component.

# File lib/components/widgets/input_text.rb, line 13
def default_model()
    ValueModel.on('')
end
on_value_changed(announcement) click to toggle source

Events

# File lib/components/widgets/input_text.rb, line 23
def on_value_changed(announcement)
    view.set_text(announcement.new_value)
end
sync_ui_from_model() click to toggle source
# File lib/components/widgets/input_text.rb, line 17
def sync_ui_from_model()
    view.set_text(model.value) unless view.nil?
end