Module: AppReport::Configuration

Defined in:
lib/app_report/configuration.rb

Constant Summary collapse

@@config_keys =
[
  :app_name,
  :access_key,
  :secret_key,
  :expires_signed_url_after
]
@@expires_signed_url_after =

expire urls after 10 minutes, by default.

600

Class Method Summary collapse

Class Method Details

.config_keysObject



42
43
44
# File 'lib/app_report/configuration.rb', line 42

def self.config_keys
  @@config_keys.clone
end

.expires_signed_url_after=(value) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/app_report/configuration.rb', line 34

def self.expires_signed_url_after= value
  unless value.kind_of? Integer and value > 0
   raise AppReport::Errors::InvalidConfigurationError, "value must be an integer > 0, not #{value}"
  end

  @@expires_signed_url_after = value
end

.validates!Object



46
47
48
49
50
# File 'lib/app_report/configuration.rb', line 46

def self.validates!
  config_keys.each do |key|
    raise AppReport::Errors::RequiredConfigurationError, "#{key} is required" if send(key).blank?
  end
end