Class: DBus::ProxyObjectFactory
- Inherits:
-
Object
- Object
- DBus::ProxyObjectFactory
- Defined in:
- lib/dbus/introspect.rb
Overview
D-Bus proxy object factory class
Class that generates and sets up a proxy object based on introspection data.
Class Method Summary collapse
-
.introspect_into(po, xml) ⇒ Object
Investigates the sub-nodes of the proxy object po based on the introspection XML data xml and sets them up recursively.
Instance Method Summary collapse
-
#build ⇒ Object
Generates, sets up and returns the proxy object.
-
#initialize(xml, bus, dest, path) ⇒ ProxyObjectFactory
constructor
Creates a new proxy object factory for the given introspection XML xml, bus, destination dest, and path.
Constructor Details
#initialize(xml, bus, dest, path) ⇒ ProxyObjectFactory
Creates a new proxy object factory for the given introspection XML xml, bus, destination dest, and path.
547 548 549 |
# File 'lib/dbus/introspect.rb', line 547 def initialize(xml, bus, dest, path) @xml, @bus, @path, @dest = xml, bus, path, dest end |
Class Method Details
.introspect_into(po, xml) ⇒ Object
Investigates the sub-nodes of the proxy object po based on the introspection XML data xml and sets them up recursively.
553 554 555 556 557 558 559 560 561 562 |
# File 'lib/dbus/introspect.rb', line 553 def ProxyObjectFactory.introspect_into(po, xml) intfs, po.subnodes = IntrospectXMLParser.new(xml).parse intfs.each do |i| poi = ProxyObjectInterface.new(po, i.name) i.methods.each_value { |m| poi.define(m) } i.signals.each_value { |s| poi.define(s) } po[i.name] = poi end po.introspected = true end |
Instance Method Details
#build ⇒ Object
Generates, sets up and returns the proxy object.
565 566 567 568 569 |
# File 'lib/dbus/introspect.rb', line 565 def build po = ProxyObject.new(@bus, @dest, @path) ProxyObjectFactory.introspect_into(po, @xml) po end |