Class: Ant::Configuration::Autoconfigs::Aws::Sqs

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/ant/configs/autoconfigs/aws/sqs.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils

#array_wrap, #parse_type, #recursive_merge, #recursive_set, #split_env_string, #symbolize

Constructor Details

#initialize(config) ⇒ Sqs

Returns a new instance of Sqs.



14
15
16
17
18
19
20
21
22
23
# File 'lib/ant/configs/autoconfigs/aws/sqs.rb', line 14

def initialize(config)
  @config = config
  @client = ::Aws::SQS::Client.new(
    symbolize(config).reject { |k, _| %i[queue test_connection].include? k }
  )
  @connection = ::Aws::SQS::Queue.new(
    url: @client.get_queue_url(queue_name: @config['queue'])[:queue_url],
    client: @client
  )
end

Class Method Details

.from_config(config) ⇒ Object



9
10
11
12
# File 'lib/ant/configs/autoconfigs/aws/sqs.rb', line 9

def self.from_config(config)
  require 'aws-sdk-sqs'
  new(config)
end

Instance Method Details

#rawObject



29
30
31
# File 'lib/ant/configs/autoconfigs/aws/sqs.rb', line 29

def raw
  @connection
end

#sanity_checkObject



25
26
27
# File 'lib/ant/configs/autoconfigs/aws/sqs.rb', line 25

def sanity_check
  false
end