Class: AwsSqsMoniter::Aws::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_sqs_moniter/aws/builder.rb,
lib/aws_sqs_moniter/aws/builder/queue_builder.rb,
lib/aws_sqs_moniter/aws/builder/topic_builder.rb,
lib/aws_sqs_moniter/aws/builder/subscription_builder.rb,
lib/aws_sqs_moniter/aws/builder/application_policy_builder.rb

Defined Under Namespace

Classes: ApplicationPolicyBuilder, QueueBuilder, SubscriptionBuilder, TopicBuilder

Instance Method Summary collapse

Constructor Details

#initialize(logger = nil) ⇒ Builder

Returns a new instance of Builder.



11
12
13
# File 'lib/aws_sqs_moniter/aws/builder.rb', line 11

def initialize logger = nil
  @logger = logger || Shoryuken::Logging.logger
end

Instance Method Details

#build_policiesObject



15
16
17
# File 'lib/aws_sqs_moniter/aws/builder.rb', line 15

def build_policies
  ApplicationPolicyBuilder.new(@logger).build
end

#build_queuesObject



19
20
21
22
23
# File 'lib/aws_sqs_moniter/aws/builder.rb', line 19

def build_queues
  Shoryuken.worker_registry.queues.each do |queue|
    QueueBuilder.new(@logger, queue).build
  end
end

#build_subscriptionsObject



31
32
33
34
35
# File 'lib/aws_sqs_moniter/aws/builder.rb', line 31

def build_subscriptions
  Shoryuken.worker_registry.queues.each do |queue|
    SubscriptionBuilder.new(@logger, queue).build
  end
end

#build_topicsObject



25
26
27
28
29
# File 'lib/aws_sqs_moniter/aws/builder.rb', line 25

def build_topics
  Shoryuken.worker_registry.topics.each do |topic|
    TopicBuilder.new(@logger, topic).build
  end
end

#delete_allObject



37
38
39
40
41
42
43
44
45
# File 'lib/aws_sqs_moniter/aws/builder.rb', line 37

def delete_all
  Shoryuken.worker_registry.queues.each do |queue|
    QueueBuilder.new(@logger, queue).delete
  end

  Shoryuken.worker_registry.topics.each do |topics|
    TopicBuilder.new(@logger, topics).delete
  end
end