Class: Zui::Component

Inherits:
Object
  • Object
show all
Defined in:
lib/zui/component_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, qml:, properties:, events:, property_map:, event_map:, container:, auto_bind:) ⇒ Component

Returns a new instance of Component.



7
8
9
10
11
12
13
14
15
16
# File 'lib/zui/component_registry.rb', line 7

def initialize(name:, qml:, properties:, events:, property_map:, event_map:, container:, auto_bind:)
  @name = name
  @qml = qml
  @properties = properties
  @events = events
  @property_map = property_map
  @event_map = event_map
  @container = container
  @auto_bind = auto_bind
end

Instance Attribute Details

#auto_bindObject (readonly)

Returns the value of attribute auto_bind.



5
6
7
# File 'lib/zui/component_registry.rb', line 5

def auto_bind
  @auto_bind
end

#containerObject (readonly)

Returns the value of attribute container.



5
6
7
# File 'lib/zui/component_registry.rb', line 5

def container
  @container
end

#event_mapObject (readonly)

Returns the value of attribute event_map.



5
6
7
# File 'lib/zui/component_registry.rb', line 5

def event_map
  @event_map
end

#eventsObject (readonly)

Returns the value of attribute events.



5
6
7
# File 'lib/zui/component_registry.rb', line 5

def events
  @events
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/zui/component_registry.rb', line 5

def name
  @name
end

#propertiesObject (readonly)

Returns the value of attribute properties.



5
6
7
# File 'lib/zui/component_registry.rb', line 5

def properties
  @properties
end

#property_mapObject (readonly)

Returns the value of attribute property_map.



5
6
7
# File 'lib/zui/component_registry.rb', line 5

def property_map
  @property_map
end

#qmlObject (readonly)

Returns the value of attribute qml.



5
6
7
# File 'lib/zui/component_registry.rb', line 5

def qml
  @qml
end

Instance Method Details

#to_hObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/zui/component_registry.rb', line 18

def to_h
  {
    "qml" => qml,
    "properties" => properties.map(&:to_s),
    "events" => events.map(&:to_s),
    "property_map" => property_map.transform_keys(&:to_s).transform_values(&:to_s),
    "event_map" => event_map.transform_keys(&:to_s).transform_values(&:to_s),
    "container" => container,
    "auto_bind" => auto_bind
  }
end