Class: Fog::Google::Pubsub::Mock
- Inherits:
-
Object
- Object
- Fog::Google::Pubsub::Mock
show all
- Includes:
- Shared
- Defined in:
- lib/fog/google/pubsub/mock.rb,
lib/fog/google/requests/pubsub/get_topic.rb,
lib/fog/google/requests/pubsub/list_topics.rb,
lib/fog/google/requests/pubsub/create_topic.rb,
lib/fog/google/requests/pubsub/delete_topic.rb,
lib/fog/google/requests/pubsub/publish_topic.rb,
lib/fog/google/requests/pubsub/get_subscription.rb,
lib/fog/google/requests/pubsub/pull_subscription.rb,
lib/fog/google/requests/pubsub/list_subscriptions.rb,
lib/fog/google/requests/pubsub/create_subscription.rb,
lib/fog/google/requests/pubsub/delete_subscription.rb,
lib/fog/google/requests/pubsub/acknowledge_subscription.rb
Instance Attribute Summary
Attributes included from Shared
#api_url, #api_version, #project
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Shared
#apply_client_options, #build_excon_response, #initialize_auth, #initialize_google_client, #request, #shared_initialize
Constructor Details
#initialize(options) ⇒ Mock
Returns a new instance of Mock.
Class Method Details
.data ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/fog/google/pubsub/mock.rb', line 11
def self.data
@data ||= Hash.new do |hash, key|
hash[key] = {
:topics => {},
:subscriptions => {}
}
end
end
|
.reset ⇒ Object
20
21
22
|
# File 'lib/fog/google/pubsub/mock.rb', line 20
def self.reset
@data = nil
end
|
Instance Method Details
#acknowledge_subscription(_subscription, _ack_ids) ⇒ Object
23
24
25
|
# File 'lib/fog/google/requests/pubsub/acknowledge_subscription.rb', line 23
def acknowledge_subscription(_subscription, _ack_ids)
raise Fog::Errors::MockNotImplemented
end
|
#create_subscription(_subscription_name, _topic, _push_config = {}, _ack_deadline_seconds = nil) ⇒ Object
31
32
33
|
# File 'lib/fog/google/requests/pubsub/create_subscription.rb', line 31
def create_subscription(_subscription_name, _topic, _push_config = {}, _ack_deadline_seconds = nil)
raise Fog::Errors::MockNotImplemented
end
|
#create_topic(_topic_name) ⇒ Object
17
18
19
|
# File 'lib/fog/google/requests/pubsub/create_topic.rb', line 17
def create_topic(_topic_name)
raise Fog::Errors::MockNotImplemented
end
|
#data ⇒ Object
24
25
26
|
# File 'lib/fog/google/pubsub/mock.rb', line 24
def data
self.class.data[project]
end
|
#delete_subscription(_subscription_name) ⇒ Object
15
16
17
|
# File 'lib/fog/google/requests/pubsub/delete_subscription.rb', line 15
def delete_subscription(_subscription_name)
raise Fog::Errors::MockNotImplemented
end
|
#delete_topic(_topic_name) ⇒ Object
15
16
17
|
# File 'lib/fog/google/requests/pubsub/delete_topic.rb', line 15
def delete_topic(_topic_name)
raise Fog::Errors::MockNotImplemented
end
|
#get_subscription(_subscription_name) ⇒ Object
15
16
17
|
# File 'lib/fog/google/requests/pubsub/get_subscription.rb', line 15
def get_subscription(_subscription_name)
raise Fog::Errors::MockNotImplemented
end
|
#get_topic(_topic_name) ⇒ Object
15
16
17
|
# File 'lib/fog/google/requests/pubsub/get_topic.rb', line 15
def get_topic(_topic_name)
raise Fog::Errors::MockNotImplemented
end
|
#list_subscriptions(_project = nil) ⇒ Object
23
24
25
|
# File 'lib/fog/google/requests/pubsub/list_subscriptions.rb', line 23
def list_subscriptions(_project = nil)
raise Fog::Errors::MockNotImplemented
end
|
#list_topics(_project = nil) ⇒ Object
23
24
25
|
# File 'lib/fog/google/requests/pubsub/list_topics.rb', line 23
def list_topics(_project = nil)
raise Fog::Errors::MockNotImplemented
end
|
#publish_topic(_topic, _messages) ⇒ Object
22
23
24
|
# File 'lib/fog/google/requests/pubsub/publish_topic.rb', line 22
def publish_topic(_topic, _messages)
raise Fog::Errors::MockNotImplemented
end
|
#pull_subscription(_subscription, _options = { :return_immediately => true, :max_messages => 10 }) ⇒ Object
34
35
36
|
# File 'lib/fog/google/requests/pubsub/pull_subscription.rb', line 34
def pull_subscription(_subscription, _options = { :return_immediately => true, :max_messages => 10 })
raise Fog::Errors::MockNotImplemented
end
|
#reset_data ⇒ Object
28
29
30
|
# File 'lib/fog/google/pubsub/mock.rb', line 28
def reset_data
self.class.data.delete(project)
end
|