File: DynamicTypeMgrDataTypeInfo.rb

package info (click to toggle)
ruby-rbvmomi 1.8.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,756 kB
  • sloc: ruby: 5,590; sh: 36; makefile: 7
file content (20 lines) | stat: -rw-r--r-- 601 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class RbVmomi::VIM::DynamicTypeMgrDataTypeInfo
  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
end