Class: RbVmomi::VIM::ObjectWithMethods

Inherits:
ObjectWithProperties show all
Defined in:
lib/rbvmomi/types.rb

Direct Known Subclasses

ManagedObject

Class Attribute Summary collapse

Class Method Summary collapse

Methods inherited from ObjectWithProperties

#_get_property, #_set_property, find_prop_desc, full_props_desc

Methods inherited from Base

to_s

Class Attribute Details

.methods_descObject

Returns the value of attribute methods_desc.



146
147
148
# File 'lib/rbvmomi/types.rb', line 146

def methods_desc
  @methods_desc
end

Class Method Details

.full_methods_descObject

XXX cache



160
161
162
# File 'lib/rbvmomi/types.rb', line 160

def full_methods_desc
  (self == ObjectWithMethods ? {} : superclass.full_methods_desc).merge methods_desc
end

.initialize(name = self.name, props = [], methods = {}) ⇒ Object



148
149
150
151
152
153
154
155
156
157
# File 'lib/rbvmomi/types.rb', line 148

def initialize name=self.name, props=[], methods={}
  super name, props
  @methods_desc = methods

  @methods_desc.each do |k,d|
    sym = k.to_sym
    define_method(sym) { |*args| _call sym, *args }
    define_method(:"#{sym}!") { |*args| _call sym, *args }
  end
end