Class: VBox::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/virtualbox/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(obj_ref) ⇒ Base

Returns a new instance of Base.



6
7
8
# File 'lib/virtualbox/base.rb', line 6

def initialize(obj_ref)
  @ref = obj_ref
end

Instance Attribute Details

#refObject (readonly)

Returns the value of attribute ref.



4
5
6
# File 'lib/virtualbox/base.rb', line 4

def ref
  @ref
end

Instance Method Details

#_thisObject



10
11
12
13
14
# File 'lib/virtualbox/base.rb', line 10

def _this
  _this = {}
  _this[:_this] = @ref unless @ref.nil?
  _this
end

#delete!Object



20
21
22
# File 'lib/virtualbox/base.rb', line 20

def delete!
  VBox::ManagedObjectRef.new(@ref).release
end

#ensure_hash(args) ⇒ Object

Raises:

  • (ArgumentError)


24
25
26
# File 'lib/virtualbox/base.rb', line 24

def ensure_hash(args)
  raise ArgumentError, 'Method arguments must be a hash' unless args.is_a?(Hash)
end

#vbox_classObject



16
17
18
# File 'lib/virtualbox/base.rb', line 16

def vbox_class
  VBox::ManagedObjectRef.new(@ref).get_interface_name
end