Class: Ruflet::UI::Services::RufletServicesComponents::BatteryControl
- Inherits:
-
Control
- Object
- Control
- Ruflet::UI::Services::RufletServicesComponents::BatteryControl
- Defined in:
- lib/ruflet_ui/ruflet/ui/services/ruflet/battery_control.rb
Constant Summary collapse
- TYPE =
"battery".freeze
- WIRE =
"Battery".freeze
Constants inherited from Control
Instance Attribute Summary
Attributes inherited from Control
#children, #id, #props, #runtime_page, #type, #wire_id
Instance Method Summary collapse
-
#initialize(id: nil, data: nil, key: nil, on_state_change: nil) ⇒ BatteryControl
constructor
A new instance of BatteryControl.
Methods inherited from Control
#emit, generate_id, #has_handler?, #on, #to_patch
Constructor Details
#initialize(id: nil, data: nil, key: nil, on_state_change: nil) ⇒ BatteryControl
Returns a new instance of BatteryControl.
11 12 13 14 15 16 17 |
# File 'lib/ruflet_ui/ruflet/ui/services/ruflet/battery_control.rb', line 11 def initialize(id: nil, data: nil, key: nil, on_state_change: nil) props = {} props[:data] = data unless data.nil? props[:key] = key unless key.nil? props[:on_state_change] = on_state_change unless on_state_change.nil? super(type: TYPE, id: id, **props) end |