Class: Awspec::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/awspec/config.rb

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



9
10
11
12
13
14
15
# File 'lib/awspec/config.rb', line 9

def initialize
  @config = {
    client_backoff: 0.0,
    client_backoff_limit: 30.0,
    client_iteration: 1
  }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *_args) ⇒ Object



33
34
35
# File 'lib/awspec/config.rb', line 33

def method_missing(method_name, *_args)
  raise UnknownConfiguration, "'#{method_name}' is not a valid configuration for Awspec."
end

Instance Method Details

#[](key) ⇒ Object



29
30
31
# File 'lib/awspec/config.rb', line 29

def [](key)
  @config.fetch(key)
end

#client_backoff(backoff) ⇒ Object



17
18
19
# File 'lib/awspec/config.rb', line 17

def client_backoff(backoff)
  @config[:client_backoff] = backoff
end

#client_backoff_limit(backoff_limit) ⇒ Object



21
22
23
# File 'lib/awspec/config.rb', line 21

def client_backoff_limit(backoff_limit)
  @config[:client_backoff_limit] = backoff_limit
end

#client_iteration(iteration) ⇒ Object



25
26
27
# File 'lib/awspec/config.rb', line 25

def client_iteration(iteration)
  @config[:client_iteration] = iteration
end