Class: Google::Compute::Data::ImageDeprecated
- Inherits:
-
Object
- Object
- Google::Compute::Data::ImageDeprecated
- Includes:
- Comparable
- Defined in:
- lib/google/compute/property/image_deprecated.rb
Overview
A class to manage data for deprecated for image.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#deleted ⇒ Object
readonly
Returns the value of attribute deleted.
-
#deprecated ⇒ Object
readonly
Returns the value of attribute deprecated.
-
#obsolete ⇒ Object
readonly
Returns the value of attribute obsolete.
-
#replacement ⇒ Object
readonly
Returns the value of attribute replacement.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
Instance Attribute Details
#deleted ⇒ Object (readonly)
Returns the value of attribute deleted.
37 38 39 |
# File 'lib/google/compute/property/image_deprecated.rb', line 37 def deleted @deleted end |
#deprecated ⇒ Object (readonly)
Returns the value of attribute deprecated.
38 39 40 |
# File 'lib/google/compute/property/image_deprecated.rb', line 38 def deprecated @deprecated end |
#obsolete ⇒ Object (readonly)
Returns the value of attribute obsolete.
39 40 41 |
# File 'lib/google/compute/property/image_deprecated.rb', line 39 def obsolete @obsolete end |
#replacement ⇒ Object (readonly)
Returns the value of attribute replacement.
40 41 42 |
# File 'lib/google/compute/property/image_deprecated.rb', line 40 def replacement @replacement end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
41 42 43 |
# File 'lib/google/compute/property/image_deprecated.rb', line 41 def state @state end |
Instance Method Details
#<=>(other) ⇒ Object
72 73 74 75 76 77 78 79 80 |
# File 'lib/google/compute/property/image_deprecated.rb', line 72 def <=>(other) return false unless other.is_a? ImageDeprecated 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/image_deprecated.rb', line 63 def ==(other) return false unless other.is_a? ImageDeprecated 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/image_deprecated.rb', line 43 def to_json(_arg = nil) { 'deleted' => deleted, 'deprecated' => deprecated, 'obsolete' => obsolete, 'replacement' => replacement, 'state' => state }.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/image_deprecated.rb', line 53 def to_s { deleted: deleted, deprecated: deprecated, obsolete: obsolete, replacement: replacement, state: state }.reject { |_k, v| v.nil? }.map { |k, v| "#{k}: #{v}" }.join(', ') end |