Methods

Class/Module Index [+]

Quicksearch

Fog::Compute::Ovirt::Shared

Public Instance Methods

ovirt_attrs(obj) click to toggle source

converts an OVIRT object into an hash for fog to consume.

# File lib/fog/ovirt/compute.rb, line 53
def ovirt_attrs obj
  opts = {:raw => obj}
  obj.instance_variables.each do |v|
    key = v.to_s.gsub("@","").to_sym
    value = obj.instance_variable_get(v)
    #ignore nil values
    next if value.nil?

    opts[key] = case value
                when OVIRT::Link
                  value.id
                when Array
                  value
                when Hash
                  value
                else
                  value.to_s.strip
                end
  end
  opts
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.