lib/cloud_powers/synapse/queue.rb in cloud_powers-1.1.0 vs lib/cloud_powers/synapse/queue.rb in cloud_powers-1.1.1
- old
+ new
@@ -110,11 +110,15 @@
# * See <tt>CloudPowers::Creatable</tt>
# * See <tt>CloudPowers::Resource</tt>
def build_queue(name:, type: :board, **config)
build_method_name = "build_#{type}"
if self.respond_to? build_method_name
- self.public_send build_method_name, name: name, **config
+ self.public_send(build_method_name,
+ name: name,
+ project_root: config[:project_root] || project_root,
+ **config
+ )
else
build_board(name: name, **config)
end
end
@@ -147,11 +151,15 @@
# * See <tt>CloudPowers::Creatable</tt>
# * See <tt>CloudPowers::Resource</tt>
def create_queue(name:, type: :board, **config)
create_method_name = "build_#{type}"
if self.respond_to? create_method_name
- self.public_send create_method_name, name: name, **config
+ self.public_send(create_method_name,
+ name: name,
+ project_root: config[:project_root] || project_root,
+ **config
+ )
else
create_queue(name: name, **config)
end
end
@@ -169,11 +177,14 @@
# queue_object = build_queue('exampleQueue')
# queue_object.address
# => https://sqs.us-west-2.amazonaws.com/81234567/exampleQueue
def build_board(name:, client: sqs, **config)
board_resource = Smash::CloudPowers::Synapse::Queue::Board.build(
- name: to_camel(name), client: client, **config
+ name: to_camel(name),
+ client: client,
+ project_root: config[:project_root] || project_root,
+ **config
)
attr_map(board_resource.call_name => board_resource) do |attribute, resource|
instance_attr_accessor attribute
resource
@@ -193,10 +204,13 @@
# Example
# create_queue('exampleQueue')
# get_queue_message_count
def create_board(name:, client: sqs, **config)
board_resource = Smash::CloudPowers::Synapse::Queue::Board.create!(
- name: to_camel(name), client: sqs
+ name: to_camel(name),
+ client: sqs,
+ project_root: config[:project_root] || project_root,
+ **config
)
attr_map(board_resource.call_name => board_resource) do |attribute, resource|
instance_attr_accessor attribute
resource