Class: Openplacos::ProxyObject
- Inherits:
-
Object
- Object
- Openplacos::ProxyObject
- Defined in:
- lib/openplacos/libclient.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#[](intfname) ⇒ Object
Retrieves an interface of the proxy object (ProxyObjectInterface instance).
-
#[]=(intfname, intf) ⇒ Object
Maps the given interface name intfname to the given interface _intf.
- #has_iface?(iface_) ⇒ Boolean
-
#initialize(connection_, introspect_) ⇒ ProxyObject
constructor
Object abstraction of a ressources Contructed from instrospect Has interfaces.
-
#interfaces ⇒ Object
Returns the interfaces of the object.
Constructor Details
#initialize(connection_, introspect_) ⇒ ProxyObject
Object abstraction of a ressources Contructed from instrospect Has interfaces
360 361 362 363 364 365 366 |
# File 'lib/openplacos/libclient.rb', line 360 def initialize(connection_, introspect_) @path = introspect_["name"] @interfaces = Hash.new introspect_["interfaces"].each_pair { |name, methods| @interfaces[name]= ProxyObjectInterface.new(connection_, self, name, methods) } end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
355 356 357 |
# File 'lib/openplacos/libclient.rb', line 355 def path @path end |
Instance Method Details
#[](intfname) ⇒ Object
Retrieves an interface of the proxy object (ProxyObjectInterface instance).
374 375 376 |
# File 'lib/openplacos/libclient.rb', line 374 def [](intfname) @interfaces[intfname] end |
#[]=(intfname, intf) ⇒ Object
Maps the given interface name intfname to the given interface _intf.
379 380 381 |
# File 'lib/openplacos/libclient.rb', line 379 def []=(intfname, intf) @interfaces[intfname] = intf end |
#has_iface?(iface_) ⇒ Boolean
383 384 385 |
# File 'lib/openplacos/libclient.rb', line 383 def has_iface?(iface_) return interfaces.include?(iface_) end |
#interfaces ⇒ Object
Returns the interfaces of the object.
369 370 371 |
# File 'lib/openplacos/libclient.rb', line 369 def interfaces @interfaces.keys end |