Class: Google::Compute::Data::InstancInitialParams
- Inherits:
-
Object
- Object
- Google::Compute::Data::InstancInitialParams
- Includes:
- Comparable
- Defined in:
- lib/google/compute/property/instance_initialize_params.rb
Overview
A class to manage data for initialize_params for instance.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#disk_name ⇒ Object
readonly
Returns the value of attribute disk_name.
-
#disk_size_gb ⇒ Object
readonly
Returns the value of attribute disk_size_gb.
-
#disk_type ⇒ Object
readonly
Returns the value of attribute disk_type.
-
#source_image ⇒ Object
readonly
Returns the value of attribute source_image.
-
#source_image_encryption_key ⇒ Object
readonly
Returns the value of attribute source_image_encryption_key.
Instance Method Summary collapse
Instance Attribute Details
#disk_name ⇒ Object (readonly)
Returns the value of attribute disk_name.
37 38 39 |
# File 'lib/google/compute/property/instance_initialize_params.rb', line 37 def disk_name @disk_name end |
#disk_size_gb ⇒ Object (readonly)
Returns the value of attribute disk_size_gb.
38 39 40 |
# File 'lib/google/compute/property/instance_initialize_params.rb', line 38 def disk_size_gb @disk_size_gb end |
#disk_type ⇒ Object (readonly)
Returns the value of attribute disk_type.
39 40 41 |
# File 'lib/google/compute/property/instance_initialize_params.rb', line 39 def disk_type @disk_type end |
#source_image ⇒ Object (readonly)
Returns the value of attribute source_image.
40 41 42 |
# File 'lib/google/compute/property/instance_initialize_params.rb', line 40 def source_image @source_image end |
#source_image_encryption_key ⇒ Object (readonly)
Returns the value of attribute source_image_encryption_key.
41 42 43 |
# File 'lib/google/compute/property/instance_initialize_params.rb', line 41 def source_image_encryption_key @source_image_encryption_key end |
Instance Method Details
#<=>(other) ⇒ Object
72 73 74 75 76 77 78 79 80 |
# File 'lib/google/compute/property/instance_initialize_params.rb', line 72 def <=>(other) return false unless other.is_a? InstancInitialParams 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
63 64 65 66 67 68 69 70 |
# File 'lib/google/compute/property/instance_initialize_params.rb', line 63 def ==(other) return false unless other.is_a? InstancInitialParams 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
43 44 45 46 47 48 49 50 51 |
# File 'lib/google/compute/property/instance_initialize_params.rb', line 43 def to_json(_arg = nil) { 'diskName' => disk_name, 'diskSizeGb' => disk_size_gb, 'diskType' => disk_type, 'sourceImage' => source_image, 'sourceImageEncryptionKey' => source_image_encryption_key }.reject { |_k, v| v.nil? }.to_json end |
#to_s ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/google/compute/property/instance_initialize_params.rb', line 53 def to_s { disk_name: disk_name, disk_size_gb: disk_size_gb, disk_type: disk_type, source_image: source_image, source_image_encryption_key: source_image_encryption_key }.reject { |_k, v| v.nil? }.map { |k, v| "#{k}: #{v}" }.join(', ') end |