Class: Google::Compute::Data::InsTemSouImaEncKey

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

Overview

A class to manage data for source_image_encryption_key for instance_template.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#raw_keyObject (readonly)

Returns the value of attribute raw_key.



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

def raw_key
  @raw_key
end

#sha256Object (readonly)

Returns the value of attribute sha256.



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

def sha256
  @sha256
end

Instance Method Details

#<=>(other) ⇒ Object



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

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

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

def to_json(_arg = nil)
  {
    'rawKey' => raw_key,
    'sha256' => sha256
  }.reject { |_k, v| v.nil? }.to_json
end

#to_sObject



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

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