Class: Google::Compute::Data::InstGrouManaNamePort
- Inherits:
-
Object
- Object
- Google::Compute::Data::InstGrouManaNamePort
show all
- Includes:
- Comparable
- Defined in:
- lib/google/compute/property/instancegroupmanager_named_ports.rb
Overview
A class to manage data for named_ports for instance_group_manager.
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
38
39
40
|
# File 'lib/google/compute/property/instancegroupmanager_named_ports.rb', line 38
def name
@name
end
|
#port ⇒ Object
Returns the value of attribute port.
39
40
41
|
# File 'lib/google/compute/property/instancegroupmanager_named_ports.rb', line 39
def port
@port
end
|
Instance Method Details
#<=>(other) ⇒ Object
64
65
66
67
68
69
70
71
72
|
# File 'lib/google/compute/property/instancegroupmanager_named_ports.rb', line 64
def <=>(other)
return false unless other.is_a? InstGrouManaNamePort
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/instancegroupmanager_named_ports.rb', line 55
def ==(other)
return false unless other.is_a? InstGrouManaNamePort
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/instancegroupmanager_named_ports.rb', line 41
def to_json(_arg = nil)
{
'name' => name,
'port' => port
}.reject { |_k, v| v.nil? }.to_json
end
|
#to_s ⇒ Object
48
49
50
51
52
53
|
# File 'lib/google/compute/property/instancegroupmanager_named_ports.rb', line 48
def to_s
{
name: name,
port: port
}.reject { |_k, v| v.nil? }.map { |k, v| "#{k}: #{v}" }.join(', ')
end
|