Class: RbVmomi::BasicTypes::ObjectWithMethods

Inherits:
ObjectWithProperties show all
Defined in:
lib/rbvmomi/basic_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, full_props_set

Methods inherited from Base

to_s

Class Attribute Details

.methods_descObject

Returns the value of attribute methods_desc.



68
69
70
# File 'lib/rbvmomi/basic_types.rb', line 68

def methods_desc
  @methods_desc
end

Class Method Details

.full_methods_descObject

XXX cache



82
83
84
# File 'lib/rbvmomi/basic_types.rb', line 82

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

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



70
71
72
73
74
75
76
77
78
79
# File 'lib/rbvmomi/basic_types.rb', line 70

def init 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