Class: SqsGrep::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/sqs-grep/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/sqs-grep/config.rb', line 17

def initialize
  @client_options = {}
  @send_to = nil
  @invoke_lambda = nil
  @lambda_client = nil
  @visibility_timeout = 30
  @wait_time_seconds = 10
  @max_count = nil
  @delete_matched = false
  @invert_match = false
  @json_format = false
end

Instance Attribute Details

#client_optionsObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def client_options
  @client_options
end

#delete_matchedObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def delete_matched
  @delete_matched
end

#invert_matchObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def invert_match
  @invert_match
end

#invoke_lambdaObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def invoke_lambda
  @invoke_lambda
end

#json_formatObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def json_format
  @json_format
end

#lambda_clientObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def lambda_client
  @lambda_client
end

#max_countObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def max_count
  @max_count
end

#patternObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def pattern
  @pattern
end

#queue_nameObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def queue_name
  @queue_name
end

#send_toObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def send_to
  @send_to
end

#sqs_clientObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def sqs_client
  @sqs_client
end

#visibility_timeoutObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def visibility_timeout
  @visibility_timeout
end

#wait_time_secondsObject

Stronger builder pattern would be nice



5
6
7
# File 'lib/sqs-grep/config.rb', line 5

def wait_time_seconds
  @wait_time_seconds
end

Instance Method Details

#validateObject



30
31
32
33
34
35
36
37
# File 'lib/sqs-grep/config.rb', line 30

def validate
  if !@pattern
    raise "Missing pattern"
  end
  if !@queue_name
    raise "Missing queue name"
  end
end