Class: Google::Compute::Data::ImageGuestOsFeatu

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/google/compute/property/image_guest_os_features.rb

Overview

A class to manage data for guest_os_features for image.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



38
39
40
# File 'lib/google/compute/property/image_guest_os_features.rb', line 38

def type
  @type
end

Instance Method Details

#<=>(other) ⇒ Object



61
62
63
64
65
66
67
68
69
# File 'lib/google/compute/property/image_guest_os_features.rb', line 61

def <=>(other)
  return false unless other.is_a? ImageGuestOsFeatu
  compare_fields(other).each do |compare|
    next if compare[:self].nil? || compare[:other].nil?
    result = compare[:self] <=> compare[:other]
    return result unless result.zero?
  end
  0
end

#==(other) ⇒ Object



52
53
54
55
56
57
58
59
# File 'lib/google/compute/property/image_guest_os_features.rb', line 52

def ==(other)
  return false unless other.is_a? ImageGuestOsFeatu
  compare_fields(other).each do |compare|
    next if compare[:self].nil? || compare[:other].nil?
    return false if compare[:self] != compare[:other]
  end
  true
end

#to_json(_arg = nil) ⇒ Object



40
41
42
43
44
# File 'lib/google/compute/property/image_guest_os_features.rb', line 40

def to_json(_arg = nil)
  {
    'type' => type
  }.reject { |_k, v| v.nil? }.to_json
end

#to_sObject



46
47
48
49
50
# File 'lib/google/compute/property/image_guest_os_features.rb', line 46

def to_s
  {
    type: type
  }.reject { |_k, v| v.nil? }.map { |k, v| "#{k}: #{v}" }.join(', ')
end