Class: Google::Compute::Data::InstaTemplAccesConfi

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

Overview

A class to manage data for access_configs for instance_template.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#nat_ipObject (readonly)

Returns the value of attribute nat_ip.



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

def nat_ip
  @nat_ip
end

#typeObject (readonly)

Returns the value of attribute type.



40
41
42
# File 'lib/google/compute/property/instancetemplate_access_configs.rb', line 40

def type
  @type
end

Instance Method Details

#<=>(other) ⇒ Object



67
68
69
70
71
72
73
74
75
# File 'lib/google/compute/property/instancetemplate_access_configs.rb', line 67

def <=>(other)
  return false unless other.is_a? InstaTemplAccesConfi
  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



58
59
60
61
62
63
64
65
# File 'lib/google/compute/property/instancetemplate_access_configs.rb', line 58

def ==(other)
  return false unless other.is_a? InstaTemplAccesConfi
  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



42
43
44
45
46
47
48
# File 'lib/google/compute/property/instancetemplate_access_configs.rb', line 42

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

#to_sObject



50
51
52
53
54
55
56
# File 'lib/google/compute/property/instancetemplate_access_configs.rb', line 50

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