Class: Ruflet::UI::Controls::RufletComponents::ImageControl
- Defined in:
- lib/ruflet_ui/ruflet/ui/controls/shared/image_control.rb
Constant Summary collapse
- TYPE =
"image".freeze
- WIRE =
"Image".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, height: nil, key: nil, paint: nil, src: nil, width: nil, x: nil, y: nil) ⇒ ImageControl
constructor
A new instance of ImageControl.
Methods inherited from Control
#emit, generate_id, #has_handler?, #on, #to_patch
Constructor Details
#initialize(id: nil, data: nil, height: nil, key: nil, paint: nil, src: nil, width: nil, x: nil, y: nil) ⇒ ImageControl
Returns a new instance of ImageControl.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/ruflet_ui/ruflet/ui/controls/shared/image_control.rb', line 11 def initialize(id: nil, data: nil, height: nil, key: nil, paint: nil, src: nil, width: nil, x: nil, y: nil) props = {} props[:data] = data unless data.nil? props[:height] = height unless height.nil? props[:key] = key unless key.nil? props[:paint] = paint unless paint.nil? props[:src] = src unless src.nil? props[:width] = width unless width.nil? props[:x] = x unless x.nil? props[:y] = y unless y.nil? super(type: TYPE, id: id, **props) end |