Class: RbVmomi::VIM::DynamicTypeMgrDataTypeInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/rbvmomi/vim/DynamicTypeMgrDataTypeInfo.rb

Overview

Copyright © 2011-2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: MIT

Instance Method Summary collapse

Instance Method Details

#toRbvmomiTypeHashObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rbvmomi/vim/DynamicTypeMgrDataTypeInfo.rb', line 5

def toRbvmomiTypeHash
  {
    self.wsdlName => {
      'kind' => 'data',
      'type-id' => self.name,
      'base-type-id' => self.base.first,
      'props' => self.property.map do |prop|
        {
          'name' => prop.name,
          'type-id-ref' => prop.type.gsub("[]", ""),
          'is-array' => (prop.type =~ /\[\]$/) ? true : false,
          'is-optional' => prop.annotation.find{|a| a.name == "optional"} ? true : false,
          'version-id-ref' => prop.version,
        }
      end,
    }
  }
end