Class: Google::Compute::Data::InstaAliasIpRange

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

Overview

A class to manage data for alias_ip_ranges for instance.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ip_cidr_rangeObject (readonly)

Returns the value of attribute ip_cidr_range.



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

def ip_cidr_range
  @ip_cidr_range
end

#subnetwork_range_nameObject (readonly)

Returns the value of attribute subnetwork_range_name.



39
40
41
# File 'lib/google/compute/property/instance_alias_ip_ranges.rb', line 39

def subnetwork_range_name
  @subnetwork_range_name
end

Instance Method Details

#<=>(other) ⇒ Object



64
65
66
67
68
69
70
71
72
# File 'lib/google/compute/property/instance_alias_ip_ranges.rb', line 64

def <=>(other)
  return false unless other.is_a? InstaAliasIpRange
  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/instance_alias_ip_ranges.rb', line 55

def ==(other)
  return false unless other.is_a? InstaAliasIpRange
  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/instance_alias_ip_ranges.rb', line 41

def to_json(_arg = nil)
  {
    'ipCidrRange' => ip_cidr_range,
    'subnetworkRangeName' => subnetwork_range_name
  }.reject { |_k, v| v.nil? }.to_json
end

#to_sObject



48
49
50
51
52
53
# File 'lib/google/compute/property/instance_alias_ip_ranges.rb', line 48

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