Class: Google::Compute::Data::UrlMapTests
- Inherits:
-
Object
- Object
- Google::Compute::Data::UrlMapTests
- Includes:
- Comparable
- Defined in:
- lib/google/compute/property/urlmap_tests.rb
Overview
A class to manage data for tests for url_map.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
38 39 40 |
# File 'lib/google/compute/property/urlmap_tests.rb', line 38 def description @description end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
39 40 41 |
# File 'lib/google/compute/property/urlmap_tests.rb', line 39 def host @host end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
40 41 42 |
# File 'lib/google/compute/property/urlmap_tests.rb', line 40 def path @path end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
41 42 43 |
# File 'lib/google/compute/property/urlmap_tests.rb', line 41 def service @service end |
Instance Method Details
#<=>(other) ⇒ Object
70 71 72 73 74 75 76 77 78 |
# File 'lib/google/compute/property/urlmap_tests.rb', line 70 def <=>(other) return false unless other.is_a? UrlMapTests 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
61 62 63 64 65 66 67 68 |
# File 'lib/google/compute/property/urlmap_tests.rb', line 61 def ==(other) return false unless other.is_a? UrlMapTests 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 |
# File 'lib/google/compute/property/urlmap_tests.rb', line 43 def to_json(_arg = nil) { 'description' => description, 'host' => host, 'path' => path, 'service' => service }.reject { |_k, v| v.nil? }.to_json end |
#to_s ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/google/compute/property/urlmap_tests.rb', line 52 def to_s { description: description, host: host, path: path, service: service }.reject { |_k, v| v.nil? }.map { |k, v| "#{k}: #{v}" }.join(', ') end |