module Fog::Ovirt::Compute::V4::Shared
Public Instance Methods
check_arguments(id, options)
click to toggle source
# File lib/fog/ovirt/requests/compute/v4/update_interface.rb, line 6 def check_arguments(id, options) raise ArgumentError, "instance id is a required parameter" unless id raise ArgumentError, "interface id is a required parameter for update-interface" unless options.key? :id end
convert_string_to_bool(value)
click to toggle source
rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
# File lib/fog/ovirt/compute/v4.rb, line 116 def convert_string_to_bool(value) case value when "true" true when "false" false when Array value.map { |elem| convert_string_to_bool(elem) } when Hash value.each do |key, elem| value[key] = convert_string_to_bool(elem) end value else value end end
get_attr_value(value, opts)
click to toggle source
rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
# File lib/fog/ovirt/compute/v4.rb, line 77 def get_attr_value(value, opts) case value when OvirtSDK4::List value.to_a when Array, Hash, DateTime value when OvirtSDK4::HighAvailability opts[:ha] = value.enabled value when OvirtSDK4::TemplateVersion OpenStruct.new(:version_name => value.version_name, :version_number => value.version_number) when OvirtSDK4::Mac value.address when OvirtSDK4::Cpu opts[:cores] = value.topology.nil? ? nil : value.topology.cores opts[:sockets] = value.topology.nil? ? nil : value.topology.sockets when OvirtSDK4::Display subject = value.certificate.subject if value.certificate { :type => value.type, :address => value.address, :port => value.port, :secure_port => value.secure_port, :keyboard_layout => value.keyboard_layout, :subject => subject, :monitors => value.monitors } when OvirtSDK4::Console { :enabled => value.enabled } else if value.class.respond_to?(:module_parent) && value.class.module_parent == OvirtSDK4 value.id if value.respond_to?(:id) else value.to_s.strip end end end