Class: Google::Compute::Data::InstancTemplatDisks

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

Overview

A class to manage data for disks for instance_template.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auto_deleteObject (readonly)

Returns the value of attribute auto_delete.



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

def auto_delete
  @auto_delete
end

#bootObject (readonly)

Returns the value of attribute boot.



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

def boot
  @boot
end

#device_nameObject (readonly)

Returns the value of attribute device_name.



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

def device_name
  @device_name
end

#disk_encryption_keyObject (readonly)

Returns the value of attribute disk_encryption_key.



41
42
43
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 41

def disk_encryption_key
  @disk_encryption_key
end

#indexObject (readonly)

Returns the value of attribute index.



42
43
44
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 42

def index
  @index
end

#initialize_paramsObject (readonly)

Returns the value of attribute initialize_params.



43
44
45
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 43

def initialize_params
  @initialize_params
end

#interfaceObject (readonly)

Returns the value of attribute interface.



44
45
46
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 44

def interface
  @interface
end

#modeObject (readonly)

Returns the value of attribute mode.



45
46
47
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 45

def mode
  @mode
end

#sourceObject (readonly)

Returns the value of attribute source.



46
47
48
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 46

def source
  @source
end

#typeObject (readonly)

Returns the value of attribute type.



47
48
49
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 47

def type
  @type
end

Instance Method Details

#<=>(other) ⇒ Object



88
89
90
91
92
93
94
95
96
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 88

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



79
80
81
82
83
84
85
86
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 79

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



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 49

def to_json(_arg = nil)
  {
    'autoDelete' => auto_delete,
    'boot' => boot,
    'deviceName' => device_name,
    'diskEncryptionKey' => disk_encryption_key,
    'index' => index,
    'initializeParams' => initialize_params,
    'interface' => interface,
    'mode' => mode,
    'source' => source,
    'type' => type
  }.reject { |_k, v| v.nil? }.to_json
end

#to_sObject



64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/google/compute/property/instancetemplate_disks.rb', line 64

def to_s
  {
    auto_delete: auto_delete,
    boot: boot,
    device_name: device_name,
    disk_encryption_key: disk_encryption_key,
    index: index,
    initialize_params: initialize_params,
    interface: interface,
    mode: mode,
    source: source,
    type: type
  }.reject { |_k, v| v.nil? }.map { |k, v| "#{k}: #{v}" }.join(', ')
end