Class: Inspec::Resources::WindowsHotfix
- Inherits:
- 
      Object
      
        - Object
- Inspec::Resources::WindowsHotfix
 
- Defined in:
- lib/inspec/resources/windows_hotfix.rb
Instance Attribute Summary collapse
- 
  
    
      #content  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    Returns the value of attribute content. 
Instance Method Summary collapse
- 
  
    
      #initialize(hotfix_id = nil)  ⇒ WindowsHotfix 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of WindowsHotfix. 
- #installed? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(hotfix_id = nil) ⇒ WindowsHotfix
Returns a new instance of WindowsHotfix.
| 16 17 18 19 20 21 22 23 24 25 | # File 'lib/inspec/resources/windows_hotfix.rb', line 16 def initialize(hotfix_id = nil) @id = hotfix_id.upcase @content = nil os = inspec.os return skip_resource "The `windows_hotfix` resource is not a feature of your OS." unless os.windows? query = "get-hotfix -id #{@id}" cmd = inspec.powershell(query) @content = cmd.stdout end | 
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
| 14 15 16 | # File 'lib/inspec/resources/windows_hotfix.rb', line 14 def content @content end | 
Instance Method Details
#installed? ⇒ Boolean
| 31 32 33 34 35 | # File 'lib/inspec/resources/windows_hotfix.rb', line 31 def installed? return false if @content.nil? @content.include?(@id) end | 
#to_s ⇒ Object
| 27 28 29 | # File 'lib/inspec/resources/windows_hotfix.rb', line 27 def to_s "Windows Hotfix #{@id}" end |