Class: Beaker::Options::OptionsHash
- Inherits:
 - 
      StringifyHash
      
        
- Object
 - StringifyHash
 - Beaker::Options::OptionsHash
 
 
- Defined in:
 - lib/beaker/options/options_hash.rb
 
Overview
A hash that treats Symbol and String keys interchangeably and recursively merges hashes
Instance Method Summary collapse
- #dump_to_file(output_file) ⇒ Object
 - 
  
    
      #get_type  ⇒ Symbol 
    
    
  
  
  
  
  
  
  
  
  
    
Determine the puppet type of the ObjectHash.
 - 
  
    
      #is_pe?  ⇒ Boolean 
    
    
  
  
  
  
  
  
  
  
  
    
Determine if type of ObjectHash is pe, defaults to true.
 
Instance Method Details
#dump_to_file(output_file) ⇒ Object
      37 38 39 40 41  | 
    
      # File 'lib/beaker/options/options_hash.rb', line 37 def dump_to_file(output_file) dirname = File.dirname(output_file) FileUtils.mkdir_p(dirname) unless File.directory?(dirname) File.write(output_file, dump) end  | 
  
#get_type ⇒ Symbol
Determine the puppet type of the ObjectHash
Default is FOSS
      28 29 30 31 32 33 34 35  | 
    
      # File 'lib/beaker/options/options_hash.rb', line 28 def get_type case self[:type] when /pe/ :pe else :foss end end  | 
  
#is_pe? ⇒ Boolean
Determine if type of ObjectHash is pe, defaults to true
      15 16 17  | 
    
      # File 'lib/beaker/options/options_hash.rb', line 15 def is_pe? self[:type] ? self[:type].include?('pe') : true end  |