Class: Async::GRPC::XDS::Resources::ClusterLoadAssignment
- Inherits:
-
Object
- Object
- Async::GRPC::XDS::Resources::ClusterLoadAssignment
- Defined in:
- lib/async/grpc/xds/resources.rb
Overview
Represents endpoint assignment (ClusterLoadAssignment) Based on envoy.config.endpoint.v3.ClusterLoadAssignment
Instance Attribute Summary collapse
-
#cluster_name ⇒ Object
readonly
Returns the value of attribute cluster_name.
-
#endpoints ⇒ Object
readonly
Returns the value of attribute endpoints.
Class Method Summary collapse
-
.from_proto(proto) ⇒ Object
Create ClusterLoadAssignment from protobuf message.
Instance Method Summary collapse
-
#initialize(data) ⇒ ClusterLoadAssignment
constructor
Initialize from protobuf or hash.
Constructor Details
#initialize(data) ⇒ ClusterLoadAssignment
Initialize from protobuf or hash
184 185 186 187 188 189 190 191 192 |
# File 'lib/async/grpc/xds/resources.rb', line 184 def initialize(data) if data.is_a?(Hash) @cluster_name = data[:cluster_name] @endpoints = parse_endpoints(data[:endpoints] || []) else @cluster_name = data.cluster_name @endpoints = parse_endpoints(data.endpoints || []) end end |
Instance Attribute Details
#cluster_name ⇒ Object (readonly)
Returns the value of attribute cluster_name.
180 181 182 |
# File 'lib/async/grpc/xds/resources.rb', line 180 def cluster_name @cluster_name end |
#endpoints ⇒ Object (readonly)
Returns the value of attribute endpoints.
180 181 182 |
# File 'lib/async/grpc/xds/resources.rb', line 180 def endpoints @endpoints end |
Class Method Details
.from_proto(proto) ⇒ Object
Create ClusterLoadAssignment from protobuf message
197 198 199 |
# File 'lib/async/grpc/xds/resources.rb', line 197 def self.from_proto(proto) new(proto) end |