Class: Google::Compute::Data::InstancTemplatPropert
- Inherits:
-
Object
- Object
- Google::Compute::Data::InstancTemplatPropert
- Includes:
- Comparable
- Defined in:
- lib/google/compute/property/instancetemplate_properties.rb
Overview
A class to manage data for properties for instance_template.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#can_ip_forward ⇒ Object
readonly
Returns the value of attribute can_ip_forward.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#disks ⇒ Object
readonly
Returns the value of attribute disks.
-
#guest_accelerators ⇒ Object
readonly
Returns the value of attribute guest_accelerators.
-
#machine_type ⇒ Object
readonly
Returns the value of attribute machine_type.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#network_interfaces ⇒ Object
readonly
Returns the value of attribute network_interfaces.
-
#scheduling ⇒ Object
readonly
Returns the value of attribute scheduling.
-
#service_accounts ⇒ Object
readonly
Returns the value of attribute service_accounts.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#==(other) ⇒ Object
rubocop:enable Metrics/MethodLength.
- #to_json(_arg = nil) ⇒ Object
-
#to_s ⇒ Object
rubocop:disable Metrics/MethodLength.
Instance Attribute Details
#can_ip_forward ⇒ Object (readonly)
Returns the value of attribute can_ip_forward.
37 38 39 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 37 def can_ip_forward @can_ip_forward end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
38 39 40 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 38 def description @description end |
#disks ⇒ Object (readonly)
Returns the value of attribute disks.
39 40 41 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 39 def disks @disks end |
#guest_accelerators ⇒ Object (readonly)
Returns the value of attribute guest_accelerators.
42 43 44 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 42 def guest_accelerators @guest_accelerators end |
#machine_type ⇒ Object (readonly)
Returns the value of attribute machine_type.
40 41 42 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 40 def machine_type @machine_type end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
41 42 43 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 41 def @metadata end |
#network_interfaces ⇒ Object (readonly)
Returns the value of attribute network_interfaces.
43 44 45 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 43 def network_interfaces @network_interfaces end |
#scheduling ⇒ Object (readonly)
Returns the value of attribute scheduling.
44 45 46 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 44 def scheduling @scheduling end |
#service_accounts ⇒ Object (readonly)
Returns the value of attribute service_accounts.
45 46 47 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 45 def service_accounts @service_accounts end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
46 47 48 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 46 def @tags end |
Instance Method Details
#<=>(other) ⇒ Object
97 98 99 100 101 102 103 104 105 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 97 def <=>(other) return false unless other.is_a? InstancTemplatPropert 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
rubocop:enable Metrics/MethodLength
88 89 90 91 92 93 94 95 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 88 def ==(other) return false unless other.is_a? InstancTemplatPropert 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
48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 48 def to_json(_arg = nil) { 'canIpForward' => can_ip_forward, 'description' => description, 'disks' => disks, 'machineType' => machine_type, 'metadata' => , 'guestAccelerators' => guest_accelerators, 'networkInterfaces' => network_interfaces, 'scheduling' => scheduling, 'serviceAccounts' => service_accounts, 'tags' => }.reject { |_k, v| v.nil? }.to_json end |
#to_s ⇒ Object
rubocop:disable Metrics/MethodLength
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/google/compute/property/instancetemplate_properties.rb', line 64 def to_s { can_ip_forward: can_ip_forward, description: description, disks: ['[', disks.map(&:to_json).join(', '), ']'].join(' '), machine_type: machine_type, metadata: , guest_accelerators: ['[', guest_accelerators.map(&:to_json).join(', '), ']'].join(' '), network_interfaces: ['[', network_interfaces.map(&:to_json).join(', '), ']'].join(' '), scheduling: scheduling, service_accounts: ['[', service_accounts.map(&:to_json).join(', '), ']'].join(' '), tags: }.reject { |_k, v| v.nil? }.map { |k, v| "#{k}: #{v}" }.join(', ') end |