Class: Google::Compute::Data::InstaTemplGuestAccel
- Inherits:
-
Object
- Object
- Google::Compute::Data::InstaTemplGuestAccel
show all
- Includes:
- Comparable
- Defined in:
- lib/google/compute/property/instancetemplate_guest_accelerators.rb
Overview
A class to manage data for guest_accelerators for instance_template.
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#accelerator_count ⇒ Object
Returns the value of attribute accelerator_count.
38
39
40
|
# File 'lib/google/compute/property/instancetemplate_guest_accelerators.rb', line 38
def accelerator_count
@accelerator_count
end
|
#accelerator_type ⇒ Object
Returns the value of attribute accelerator_type.
39
40
41
|
# File 'lib/google/compute/property/instancetemplate_guest_accelerators.rb', line 39
def accelerator_type
@accelerator_type
end
|
Instance Method Details
#<=>(other) ⇒ Object
64
65
66
67
68
69
70
71
72
|
# File 'lib/google/compute/property/instancetemplate_guest_accelerators.rb', line 64
def <=>(other)
return false unless other.is_a? InstaTemplGuestAccel
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
55
56
57
58
59
60
61
62
|
# File 'lib/google/compute/property/instancetemplate_guest_accelerators.rb', line 55
def ==(other)
return false unless other.is_a? InstaTemplGuestAccel
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
41
42
43
44
45
46
|
# File 'lib/google/compute/property/instancetemplate_guest_accelerators.rb', line 41
def to_json(_arg = nil)
{
'acceleratorCount' => accelerator_count,
'acceleratorType' => accelerator_type
}.reject { |_k, v| v.nil? }.to_json
end
|
#to_s ⇒ Object
48
49
50
51
52
53
|
# File 'lib/google/compute/property/instancetemplate_guest_accelerators.rb', line 48
def to_s
{
accelerator_count: accelerator_count,
accelerator_type: accelerator_type
}.reject { |_k, v| v.nil? }.map { |k, v| "#{k}: #{v}" }.join(', ')
end
|