Class: Google::Compute::Data::BackendServiceBackend

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

Overview

A class to manage data for backends for backend_service.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#balancing_modeObject (readonly)

Returns the value of attribute balancing_mode.



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

def balancing_mode
  @balancing_mode
end

#capacity_scalerObject (readonly)

Returns the value of attribute capacity_scaler.



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

def capacity_scaler
  @capacity_scaler
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#groupObject (readonly)

Returns the value of attribute group.



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

def group
  @group
end

#max_connectionsObject (readonly)

Returns the value of attribute max_connections.



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

def max_connections
  @max_connections
end

#max_connections_per_instanceObject (readonly)

Returns the value of attribute max_connections_per_instance.



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

def max_connections_per_instance
  @max_connections_per_instance
end

#max_rateObject (readonly)

Returns the value of attribute max_rate.



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

def max_rate
  @max_rate
end

#max_rate_per_instanceObject (readonly)

Returns the value of attribute max_rate_per_instance.



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

def max_rate_per_instance
  @max_rate_per_instance
end

#max_utilizationObject (readonly)

Returns the value of attribute max_utilization.



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

def max_utilization
  @max_utilization
end

Instance Method Details

#<=>(other) ⇒ Object



85
86
87
88
89
90
91
92
93
# File 'lib/google/compute/property/backendservice_backends.rb', line 85

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



76
77
78
79
80
81
82
83
# File 'lib/google/compute/property/backendservice_backends.rb', line 76

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



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

def to_json(_arg = nil)
  {
    'balancingMode' => balancing_mode,
    'capacityScaler' => capacity_scaler,
    'description' => description,
    'group' => group,
    'maxConnections' => max_connections,
    'maxConnectionsPerInstance' => max_connections_per_instance,
    'maxRate' => max_rate,
    'maxRatePerInstance' => max_rate_per_instance,
    'maxUtilization' => max_utilization
  }.reject { |_k, v| v.nil? }.to_json
end

#to_sObject



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/google/compute/property/backendservice_backends.rb', line 62

def to_s
  {
    balancing_mode: balancing_mode,
    capacity_scaler: capacity_scaler,
    description: description,
    group: group,
    max_connections: max_connections,
    max_connections_per_instance: max_connections_per_instance,
    max_rate: max_rate,
    max_rate_per_instance: max_rate_per_instance,
    max_utilization: max_utilization
  }.reject { |_k, v| v.nil? }.map { |k, v| "#{k}: #{v}" }.join(', ')
end