Class: Openplacos::ProxyObject

Inherits:
Object
  • Object
show all
Defined in:
lib/openplacos/libclient.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (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

Returns:

  • (Boolean)


383
384
385
# File 'lib/openplacos/libclient.rb', line 383

def has_iface?(iface_)
  return interfaces.include?(iface_)
end

#interfacesObject

Returns the interfaces of the object.



369
370
371
# File 'lib/openplacos/libclient.rb', line 369

def interfaces
  @interfaces.keys
end