Class: Hackmac::ContainerDisk

Inherits:
Disks
  • Object
show all
Defined in:
lib/hackmac/disks.rb

Instance Method Summary collapse

Methods included from Plist

#as_hash, #method_missing, #plist, #to_json

Constructor Details

#initialize(disk:, limiter: nil) ⇒ ContainerDisk

Returns a new instance of ContainerDisk.



24
25
26
27
28
29
30
# File 'lib/hackmac/disks.rb', line 24

def initialize(disk:, limiter: nil)
  @disk = disk
  device = `#{Shellwords.join(%w[ diskutil list ] << disk)}`.
    lines.grep(/Apple_APFS/).first&.split(/\s+/)&.[](4)

  super device: device, limiter: limiter
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Hackmac::Plist