Class: LazyDVPort

Inherits:
Object
  • Object
show all
Includes:
RVC::InventoryObject
Defined in:
lib/rvc/extensions/DistributedVirtualPortgroup.rb

Overview

XXX can we use a lazy delegate but not fetch the object during ‘ls`?

Instance Attribute Summary

Attributes included from RVC::InventoryObject

#rvc_arc, #rvc_parent

Instance Method Summary collapse

Methods included from RVC::InventoryObject

#children, included, #ls_text, #rvc_link, #rvc_path, #rvc_path_str, #rvc_relative_path, #rvc_relative_path_str, #traverse_one

Methods included from RVC::ObjectWithFields::ClassMethods

#field, #fields

Methods included from RVC::ObjectWithFields

#field, #field_properties, #perfmetrics

Constructor Details

#initialize(pg, key) ⇒ LazyDVPort

Returns a new instance of LazyDVPort.



242
243
244
245
# File 'lib/rvc/extensions/DistributedVirtualPortgroup.rb', line 242

def initialize(pg, key)
  @pg = pg
  @key = key
end

Instance Method Details

#display_infoObject



251
252
253
# File 'lib/rvc/extensions/DistributedVirtualPortgroup.rb', line 251

def display_info
  self.get_real_port.display_info
end

#get_real_portObject



247
248
249
# File 'lib/rvc/extensions/DistributedVirtualPortgroup.rb', line 247

def get_real_port
  @port ||= @pg.config.distributedVirtualSwitch.FetchDVPorts(:criteria => {:portKey => [@key]})[0]
end