Class: Temporalio::WorkerDeploymentVersion
- Inherits:
-
Object
- Object
- Temporalio::WorkerDeploymentVersion
- Defined in:
- lib/temporalio/worker_deployment_version.rb
Overview
Represents the version of a specific worker deployment.
WARNING: Experimental API.
Class Method Summary collapse
-
.from_canonical_string(canonical) ⇒ WorkerDeploymentVersion
Parse a version from a canonical string, which must be in the format ‘<deployment_name>.<build_id>`.
Instance Method Summary collapse
-
#initialize(deployment_name:, build_id:) ⇒ WorkerDeploymentVersion
constructor
Create WorkerDeploymentVersion.
-
#to_canonical_string ⇒ String
Returns the canonical string representation of the version.
Constructor Details
#initialize(deployment_name:, build_id:) ⇒ WorkerDeploymentVersion
Create WorkerDeploymentVersion.
40 41 42 |
# File 'lib/temporalio/worker_deployment_version.rb', line 40 def initialize(deployment_name:, build_id:) # rubocop:disable Lint/UselessMethodDefinition super end |
Class Method Details
.from_canonical_string(canonical) ⇒ WorkerDeploymentVersion
Parse a version from a canonical string, which must be in the format ‘<deployment_name>.<build_id>`. Deployment name must not have a `.` in it.
20 21 22 23 24 25 26 27 |
# File 'lib/temporalio/worker_deployment_version.rb', line 20 def self.from_canonical_string(canonical) parts = canonical.split('.', 2) if parts.length != 2 raise ArgumentError, "Cannot parse version string: #{canonical}, must be in format <deployment_name>.<build_id>" end new(deployment_name: parts[0], build_id: parts[1]) end |
Instance Method Details
#to_canonical_string ⇒ String
Returns the canonical string representation of the version.
47 48 49 |
# File 'lib/temporalio/worker_deployment_version.rb', line 47 def to_canonical_string "#{deployment_name}.#{build_id}" end |