Class: Google::Compute::Data::UrlMapTests

Inherits:
Object
  • Object
show all
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

UrlMapTestsApi, UrlMapTestsCatalog

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#hostObject (readonly)

Returns the value of attribute host.



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

def host
  @host
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

#serviceObject (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_sObject



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