Class: Ruflet::UI::Controls::RufletComponents::SimpleAttributionControl

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

Constant Summary collapse

TYPE =
"simpleattribution".freeze
WIRE =
"SimpleAttribution".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, text: nil, alignment: nil, bgcolor: nil, text_style: nil, url: nil, on_click: nil) ⇒ SimpleAttributionControl

Returns a new instance of SimpleAttributionControl.



226
227
228
229
230
231
232
233
234
235
# File 'lib/ruflet_ui/ruflet/ui/controls/materials/map_controls.rb', line 226

def initialize(id: nil, text: nil, alignment: nil, bgcolor: nil, text_style: nil, url: nil, on_click: nil)
  props = {}
  props[:text] = text unless text.nil?
  props[:alignment] = alignment unless alignment.nil?
  props[:bgcolor] = bgcolor unless bgcolor.nil?
  props[:text_style] = text_style unless text_style.nil?
  props[:url] = url unless url.nil?
  props[:on_click] = on_click unless on_click.nil?
  super(type: TYPE, id: id, **props)
end