Open
Conversation
|
Hey guys. I'd love this as well. Here's a use case I'm running into: I try renaming a network interface through the NetworkAdapter returned and instead blank it out: [89] pry(main)> a = WMI::Win32_NetworkAdapter.find(:all, :conditions => { :net_connection_id => 'test2' } ).first
=> #<RubyWMI::Win32_NetworkAdapter:Intel(R) PRO/1000 MT Desktop Adapter>
[90] pry(main)> a.NetConnectionID
=> "test2"
[91] pry(main)> a.NetConnectionID = 'test3'
=> "test3"
[92] pry(main)> a.NetConnectionID
=> nil
[93] pry(main)> w = a.instance_variable_get(:@win32ole_object)
=> #<WIN32OLE:0x34568b8>
[94] pry(main)> w.NetConnectionID
=> nilNow I get the instance variable from the NetworkAdapter returned and am able to properly rename it: [95] pry(main)> a = WMI::Win32_NetworkAdapter.find(:all, :conditions => { :net_connection_id => 'test2' } ).first
=> #<RubyWMI::Win32_NetworkAdapter:Intel(R) PRO/1000 MT Desktop Adapter>
[96] pry(main)> w = a.instance_variable_get(:@win32ole_object)
=> #<WIN32OLE:0x3535f80>
[97] pry(main)> w.NetConnectionID
=> "test2"
[98] pry(main)> w.NetConnectionID = 'test3'
=> "test3"
[99] pry(main)> w.NetConnectionID
=> "test3"
[100] pry(main)> a.Put_
=> #<WIN32OLE:0x3393858>
[101] pry(main)> w.NetConnectionID
=> "test3"
[102] pry(main)> a.NetConnectionID
=> "test3"
[103] pry(main)>Now I monkeypatch this edit in and can also rename now through NetworkAdapter as expected: [105] pry(main)> a = WMI::Win32_NetworkAdapter.find(:all, :conditions => { :net_connection_id => 'test3' } ).first
=> #<RubyWMI::Win32_NetworkAdapter:Intel(R) PRO/1000 MT Desktop Adapter>
[106] pry(main)> a.NetConnectionID
=> "test3"
[107] pry(main)> a.NetConnectionID = 'test4'
=> "test4"
[108] pry(main)> a.NetConnectionID
=> "test4"
[109] pry(main)> a.Put_
=> #<WIN32OLE:0x35ead90> |
|
Any chance of merging this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.