Class: VirtualBox::Media

Inherits:
AbstractModel show all
Defined in:
lib/virtualbox/media.rb

Overview

Represents the media registry within the global VirtualBox configuration.

Class Method Summary

Instance Method Summary

Methods inherited from AbstractModel

#destroy, #errors, #existing_record!, #inspect, #lazy_attribute?, #lazy_relationship?, #new_record!, #new_record?, #populate_attributes, #populate_relationship, #populate_relationships, #reload!, reload!, reload?, reloaded!, #save, #save_attribute, #set_relationship, #validate, #write_attribute

Methods included from AbstractModel::Attributable

#attributes, #has_attribute?, included, #lazy_attribute?, #loaded_attribute?, #populate_attributes, #read_attribute, #readonly_attribute?, #write_attribute

Methods included from AbstractModel::Dirty

#changed?, #changes, #clear_dirty!, #ignore_dirty, #method_missing, #set_dirty!

Methods included from AbstractModel::Relatable

#destroy_relationship, #destroy_relationships, #has_relationship?, included, #lazy_relationship?, #loaded_relationship?, #populate_relationship, #populate_relationships, #read_relationship, #relationship_data, #save_relationship, #save_relationships, #set_relationship

Methods included from AbstractModel::Validatable

#add_error, #clear_errors, #errors, #valid?, #validate, #validates_presence_of

Constructor Details

- (Media) initialize(parent, document)

A new instance of Media



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

def initialize(parent, document)
  populate_attributes({ :parent => parent }, :ignore_relationships => true)
  populate_relationships(document)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class VirtualBox::AbstractModel::Dirty

Class Method Details

+ (Object) populate_relationship(caller, data)



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

def populate_relationship(caller, data)
  new(caller, data)
end