Class: LazyDVPort
- Inherits:
-
Object
- Object
- LazyDVPort
- 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
Instance Method Summary collapse
- #display_info ⇒ Object
- #get_real_port ⇒ Object
-
#initialize(pg, key) ⇒ LazyDVPort
constructor
A new instance of LazyDVPort.
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
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_info ⇒ Object
251 252 253 |
# File 'lib/rvc/extensions/DistributedVirtualPortgroup.rb', line 251 def display_info self.get_real_port.display_info end |
#get_real_port ⇒ Object
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 |