Class: VagrantHosts::Cap::Facts::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-hosts/cap/facts/base.rb

Overview

Base class for retrieving network facts from guest VMs

Since:

  • 2.8.0

Direct Known Subclasses

POSIX, Windows

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(machine) ⇒ Base

Returns a new instance of Base.

Since:

  • 2.8.0



17
18
19
# File 'lib/vagrant-hosts/cap/facts/base.rb', line 17

def initialize(machine)
  @machine = machine
end

Instance Attribute Details

#machineObject (readonly)

Since:

  • 2.8.0



15
16
17
# File 'lib/vagrant-hosts/cap/facts/base.rb', line 15

def machine
  @machine
end

Class Method Details

.network_facts(machine) ⇒ Hash

Retrieve facts from a guest VM

See #load_facts for implementation details.

Returns:

  • (Hash)

    A hash of facts.

Since:

  • 2.8.0



11
12
13
# File 'lib/vagrant-hosts/cap/facts/base.rb', line 11

def self.network_facts(machine)
  new(machine).load_facts
end

Instance Method Details

#load_factsObject

Raises:

  • (NotImplementedError)

Since:

  • 2.8.0



21
22
23
# File 'lib/vagrant-hosts/cap/facts/base.rb', line 21

def load_facts
  raise NotImplementedError
end