Class: Comatose::Configuration
- Inherits:
-
Object
- Object
- Comatose::Configuration
- Defined in:
- lib/comatose/configuration.rb
Defined Under Namespace
Classes: ConfigurationError
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
52 53 54 55 56 57 58 59 |
# File 'lib/comatose/configuration.rb', line 52 def initialize # Default procs for blockable attrs.... = Proc.new { true } = Proc.new { true } = Proc.new { request.env['REMOTE_ADDR'] } @admin_get_root_page = Proc.new { ComatosePage.root } @after_setup = Proc.new { true } end |
Instance Method Details
#validate! ⇒ Object
61 62 63 64 65 66 67 |
# File 'lib/comatose/configuration.rb', line 61 def validate! # Rips through the config and validates it's, er, valid raise ConfigurationError.new( "admin_get_author must be a Proc or Symbol" ) unless .is_a? Proc or .is_a? Symbol raise ConfigurationError.new( "admin_authorization must be a Proc or Symbol" ) unless .is_a? Proc or .is_a? Symbol raise ConfigurationError.new( "authorization must be a Proc or Symbol" ) unless .is_a? Proc or .is_a? Symbol true end |