Class: VBox::Base

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

Instance Method Summary collapse

Constructor Details

#initialize(obj_ref) ⇒ Base

Returns a new instance of Base.



9
10
11
# File 'lib/virtualbox/base.rb', line 9

def initialize(obj_ref)
  @ref = obj_ref
end

Instance Method Details

#_thisObject



13
14
15
16
17
# File 'lib/virtualbox/base.rb', line 13

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

#delete!Object



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

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

#ensure_hash(args) ⇒ Object

Raises:

  • (ArgumentError)


27
28
29
# File 'lib/virtualbox/base.rb', line 27

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

#vbox_classObject



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

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