Class: Fog::Google::Pubsub::Subscriptions
- Inherits:
-
Collection
- Object
- Collection
- Fog::Google::Pubsub::Subscriptions
- Defined in:
- lib/fog/google/models/pubsub/subscriptions.rb
Instance Method Summary collapse
-
#all ⇒ Array<Fog::Google::Pubsub::Subscription>
Lists all subscriptions that exist on the project.
-
#get(subscription_name) ⇒ Fog::Google::Pubsub::Topic
Retrieves a subscription by name.
Instance Method Details
#all ⇒ Array<Fog::Google::Pubsub::Subscription>
Lists all subscriptions that exist on the project.
14 15 16 17 |
# File 'lib/fog/google/models/pubsub/subscriptions.rb', line 14 def all data = service.list_subscriptions.to_h[:subscriptions] || [] load(data) end |
#get(subscription_name) ⇒ Fog::Google::Pubsub::Topic
Retrieves a subscription by name
23 24 25 26 27 28 29 |
# File 'lib/fog/google/models/pubsub/subscriptions.rb', line 23 def get(subscription_name) subscription = service.get_subscription(subscription_name).to_h new(subscription) rescue ::Google::Apis::ClientError => e raise e unless e.status_code == 404 nil end |