Class: Hackmac::IOReg
Instance Method Summary collapse
-
#initialize(key:) ⇒ IOReg
constructor
A new instance of IOReg.
Methods included from Plist
#as_hash, #each, #method_missing, #plist, #to_json
Constructor Details
#initialize(key:) ⇒ IOReg
Returns a new instance of IOReg.
7 8 9 10 11 |
# File 'lib/hackmac/ioreg.rb', line 7 def initialize(key:) plist *(%w[ioreg -a -p IOService -r -k ] << key) @plist.extend Hashie::Extensions::DeepFind @plist = @plist.deep_find_all(key).max_by(&:size) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Hackmac::Plist