Class: OmniHooks::Configuration
- Inherits:
-
Object
- Object
- OmniHooks::Configuration
- Includes:
- Singleton
- Defined in:
- lib/omnihooks.rb
Instance Attribute Summary collapse
-
#allowed_request_methods ⇒ Object
Returns the value of attribute allowed_request_methods.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#path_prefix ⇒ Object
Returns the value of attribute path_prefix.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_methods ⇒ Object
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 |
#logger ⇒ Object
Returns the value of attribute logger.
24 25 26 |
# File 'lib/omnihooks.rb', line 24 def logger @logger end |
#path_prefix ⇒ Object
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_logger ⇒ Object
26 27 28 29 30 |
# File 'lib/omnihooks.rb', line 26 def self.default_logger logger = Logger.new(STDOUT) logger.progname = 'omnihooks' logger end |
.defaults ⇒ Object
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 |