diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index fc638ca..050dcbc 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -57,7 +57,7 @@ This example uses {VirtualBox::VM}, which will probably be the most common model you search for. vm = VirtualBox::VM.find("MyVM") - puts "This VM has #{vm.memory} MB of RAM allocated to it." + puts "This VM has #{vm.memory_size} MB of RAM allocated to it." Find can also be used with UUIDs: @@ -90,10 +90,10 @@ Reading attributes is simple. Let's use a {VirtualBox::VM} as an example: vm = VirtualBox::VM.find("FooVM") # Accessing attributes: - vm.memory + vm.memory_size vm.name - vm.boot1 - vm.ioapic + vm.boot_order[0] + vm.bios.io_apic_enabled ### Relationships @@ -105,7 +105,7 @@ Relationships are read the exact same way as attributes. Again using a # storage_controllers is a relationship containing an array of all the # storage controllers on this VM vm.storage_controllers.each do |sc| - puts "Storage Controller: #{sc.uuid}" + puts "Storage Controller: #{sc.name}" end The difference from an attribute is that while attributes are typically ruby @@ -140,7 +140,7 @@ Attributes which support modification are modified like standard ruby attributes following example uses {VirtualBox::HardDrive}: hd = VirtualBox::HardDrive.new - hd.size = 2000 # megabytes + hd.logical_size = 2000 # megabytes hd.format = "VMDK" As you can see, there is nothing sneaky going on here, and does what you expect. @@ -172,25 +172,22 @@ Saving models is _really_ easy: you simply call `save`. That's all! Well, there some subtleties, but that's the basic idea. `save` will typically **also save relationships** so if you modify a relationship object or relationship itself, calling `save` on the parent object will typically save the relationships as well. `save` always returns -`true` or `false` depending on whether the operation was a success or not. If you'd like -instead to know why a `save` failed, you can call the method with a `true` parameter -which sets `raise_errors` to `true` and will raise a {VirtualBox::Exceptions::CommandFailedException} -if there is a failure. The message on this object contains the reason. +`true` or `false` depending on whether the operation was a success or not. Below is an example of saving a simple {VirtualBox::VM} object: vm = VirtualBox::VM.find("FooVM") # Double the memory - vm.memory = vm.memory.to_i * 2 + vm.memory_size = vm.memory_size.to_i * 2 # This will return true/false depending on success vm.save -Below is an example where an exception will be raised if an error occurs: +Below is an example which will return `false`: vm = VirtualBox::VM.find("FooVM") - vm.memory = "INVALID" + vm.memory_size = "INVALID" - # This will raise an exception, since the memory is invalid - vm.save(true) \ No newline at end of file + # This will return false, since the memory is invalid + vm.save