Class: Ruflet::UI::Controls::RufletComponents::LineControl

Inherits:
Control
  • Object
show all
Defined in:
lib/ruflet_ui/ruflet/ui/controls/shared/line_control.rb

Constant Summary collapse

TYPE =
"line".freeze
WIRE =
"Line".freeze

Constants inherited from Control

Control::HOST_EXPANDED_TYPES

Instance Attribute Summary

Attributes inherited from Control

#children, #id, #props, #runtime_page, #type, #wire_id

Instance Method Summary collapse

Methods inherited from Control

#emit, generate_id, #has_handler?, #on, #to_patch

Constructor Details

#initialize(id: nil, data: nil, key: nil, paint: nil, x1: nil, x2: nil, y1: nil, y2: nil) ⇒ LineControl

Returns a new instance of LineControl.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ruflet_ui/ruflet/ui/controls/shared/line_control.rb', line 11

def initialize(id: nil, data: nil, key: nil, paint: nil, x1: nil, x2: nil, y1: nil, y2: nil)
  props = {}
  props[:data] = data unless data.nil?
  props[:key] = key unless key.nil?
  props[:paint] = paint unless paint.nil?
  props[:x1] = x1 unless x1.nil?
  props[:x2] = x2 unless x2.nil?
  props[:y1] = y1 unless y1.nil?
  props[:y2] = y2 unless y2.nil?
  super(type: TYPE, id: id, **props)
end