Module: Plushie::Widget::Checkbox::CheckedRemap

Included in:
Plushie::Widget::Checkbox
Defined in:
lib/plushie/widget/checkbox.rb

Overview

Remap :is_toggled to :checked on the wire.

Instance Method Summary collapse

Instance Method Details

#buildObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Remap :is_toggled prop to :checked on the wire.



25
26
27
28
29
30
31
32
# File 'lib/plushie/widget/checkbox.rb', line 25

def build
  node = super
  props = node.props.dup
  if props.key?(:is_toggled)
    props[:checked] = props.delete(:is_toggled)
  end
  Node.new(id: node.id, type: node.type, props: props)
end