Class: VagrantPlugins::AVF::HostPlatform

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_provider_avf/host_platform.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(os:, cpu:) ⇒ HostPlatform

Returns a new instance of HostPlatform.



15
16
17
18
# File 'lib/vagrant_provider_avf/host_platform.rb', line 15

def initialize(os:, cpu:)
  @os = os
  @cpu = cpu
end

Instance Attribute Details

#cpuObject (readonly)

Returns the value of attribute cpu.



6
7
8
# File 'lib/vagrant_provider_avf/host_platform.rb', line 6

def cpu
  @cpu
end

#osObject (readonly)

Returns the value of attribute os.



6
7
8
# File 'lib/vagrant_provider_avf/host_platform.rb', line 6

def os
  @os
end

Class Method Details

.currentObject



8
9
10
11
12
13
# File 'lib/vagrant_provider_avf/host_platform.rb', line 8

def self.current
  new(
    os: RbConfig::CONFIG.fetch("host_os"),
    cpu: RbConfig::CONFIG.fetch("host_cpu")
  )
end

Instance Method Details

#descriptionObject



24
25
26
# File 'lib/vagrant_provider_avf/host_platform.rb', line 24

def description
  "#{@os}/#{@cpu}"
end

#supported?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/vagrant_provider_avf/host_platform.rb', line 20

def supported?
  macos? && apple_silicon?
end