Class: Pubilion::Config
- Inherits:
-
Object
- Object
- Pubilion::Config
- Defined in:
- lib/pubilion/config.rb
Overview
Configuration for Pubilion
Class Attribute Summary collapse
-
.credentials ⇒ String?
Credentials file path for access to Cloud Pub/Sub.
-
.project_id ⇒ String?
Google Cloud Project ID.
-
.subscription ⇒ String?
Subscription name.
-
.topic ⇒ String?
Topic name of subscription.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ void
Configure Pubilion.
Class Attribute Details
.credentials ⇒ String?
Credentials file path for access to Cloud Pub/Sub. If not set, it will try to get from environment variable GOOGLE_APPLICATION_CREDENTIALS
. If not set and GOOGLE_APPLICATION_CREDENTIALS
is not set, it will implicitly set by Google Cloud SDK.
38 39 40 |
# File 'lib/pubilion/config.rb', line 38 def credentials @credentials ||= ENV.fetch("GOOGLE_APPLICATION_CREDENTIALS", nil) end |
.project_id ⇒ String?
Google Cloud Project ID. If it is not set, it will try to get from environment variable PUBSUB_PROJECT_ID
. If it still unsettled, implicitly set by Google Cloud SDK.
29 30 31 |
# File 'lib/pubilion/config.rb', line 29 def project_id @project_id ||= ENV.fetch("PUBSUB_PROJECT_ID", nil) end |
.subscription ⇒ String?
Subscription name. If not set, it will try to get from PUBSUB_SUBSCRIPTION
. This configuration is required for Pubilion::Worker
.
56 57 58 |
# File 'lib/pubilion/config.rb', line 56 def subscription @subscription ||= ENV.fetch("PUBSUB_SUBSCRIPTION", nil) end |
.topic ⇒ String?
Topic name of subscription. If not set, it will try to get from PUBSUB_TOPIC
. This configuration is required for Pubilion::Worker
.
47 48 49 |
# File 'lib/pubilion/config.rb', line 47 def topic @topic ||= ENV.fetch("PUBSUB_TOPIC", nil) end |
Class Method Details
.configure {|config| ... } ⇒ void
This method returns an undefined value.
Configure Pubilion.
20 21 22 |
# File 'lib/pubilion/config.rb', line 20 def configure yield self end |