Class: Gcloud::Logging::ResourceDescriptor::LabelDescriptor
- Inherits:
-
Object
- Object
- Gcloud::Logging::ResourceDescriptor::LabelDescriptor
- Defined in:
- lib/gcloud/logging/resource_descriptor.rb
Overview
# LabelDescriptor
A definition of a label that can be used to describe instances of a Gcloud::Logging::Resource. For example, Cloud SQL databases must be labeled with their ‘database_id`. See #labels.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
A human-readable description for the label.
-
#key ⇒ Object
readonly
The key (name) of the label.
-
#type ⇒ Symbol?
readonly
The type of data that can be assigned to the label.
Class Method Summary collapse
-
.from_grpc(grpc) ⇒ Object
object.
Instance Attribute Details
#description ⇒ Object (readonly)
A human-readable description for the label.
119 120 121 |
# File 'lib/gcloud/logging/resource_descriptor.rb', line 119 def description @description end |
#key ⇒ Object (readonly)
The key (name) of the label.
107 108 109 |
# File 'lib/gcloud/logging/resource_descriptor.rb', line 107 def key @key end |
#type ⇒ Symbol? (readonly)
The type of data that can be assigned to the label.
115 116 117 |
# File 'lib/gcloud/logging/resource_descriptor.rb', line 115 def type @type end |
Class Method Details
.from_grpc(grpc) ⇒ Object
object.
124 125 126 127 128 129 130 131 132 133 |
# File 'lib/gcloud/logging/resource_descriptor.rb', line 124 def self.from_grpc grpc type_sym = { STRING: :string, BOOL: :boolean, INT64: :integer }[grpc.value_type] l = new l.instance_variable_set "@key", grpc.key l.instance_variable_set "@type", type_sym l.instance_variable_set "@description", grpc.description l end |