Class: Vagrant::Smartos::Zones::Cap::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/smartos/zones/cap/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(machine) ⇒ Base

Returns a new instance of Base.



14
15
16
# File 'lib/vagrant/smartos/zones/cap/base.rb', line 14

def initialize(machine)
  @machine = machine
end

Instance Attribute Details

#machineObject (readonly)

Returns the value of attribute machine.



6
7
8
# File 'lib/vagrant/smartos/zones/cap/base.rb', line 6

def machine
  @machine
end

Class Method Details

.cap_method(method_name) ⇒ Object



8
9
10
11
12
# File 'lib/vagrant/smartos/zones/cap/base.rb', line 8

def self.cap_method(method_name)
  self.class.send :define_method, method_name do |machine|
    new(machine).execute
  end
end

Instance Method Details

#sudoObject



22
23
24
# File 'lib/vagrant/smartos/zones/cap/base.rb', line 22

def sudo
  machine.config.smartos.suexec_cmd
end

#uiObject



18
19
20
# File 'lib/vagrant/smartos/zones/cap/base.rb', line 18

def ui
  machine.ui
end