Class: OmniHooks::Configuration

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



40
41
42
# File 'lib/omnihooks.rb', line 40

def initialize
  self.class.defaults.each_pair { |k, v| send("#{k}=", v) }
end

Instance Attribute Details

#allowed_request_methodsObject

Returns the value of attribute allowed_request_methods.



24
25
26
# File 'lib/omnihooks.rb', line 24

def allowed_request_methods
  @allowed_request_methods
end

#loggerObject

Returns the value of attribute logger.



24
25
26
# File 'lib/omnihooks.rb', line 24

def logger
  @logger
end

#path_prefixObject

Returns the value of attribute path_prefix.



24
25
26
# File 'lib/omnihooks.rb', line 24

def path_prefix
  @path_prefix
end

Class Method Details

.default_loggerObject



26
27
28
29
30
# File 'lib/omnihooks.rb', line 26

def self.default_logger
  logger = Logger.new(STDOUT)
  logger.progname = 'omnihooks'
  logger
end

.defaultsObject



32
33
34
35
36
37
38
# File 'lib/omnihooks.rb', line 32

def self.defaults
  @defaults ||= {
    logger: default_logger,
    path_prefix: '/hooks',
    allowed_request_methods: [:post]
  }
end