Module: Kharon::Factory
- Defined in:
- lib/validator_factory.rb
Constant Summary collapse
- @@use_exceptions =
Returns TRUE if Kharon currently use exceptions, FALSE if not.
true
Instance Attribute Summary collapse
Class Method Summary collapse
-
.configure(&block) ⇒ Object
Allows you to pass a whole block to configure the Kharon module.
-
.use_exceptions(status) ⇒ Object
Sets the use of exceptions in the whole process.
-
.uses_exceptions? ⇒ Boolean
Fancy method to know if the module uses the exceptions or not.
-
.validator(datas) ⇒ Object
Acts as a creation method for validators, considering the options you transmitted.
Instance Attribute Details
#use_exceptions ⇒ Object
|
# File 'lib/validator_factory.rb', line 7
|
Class Method Details
.configure(&block) ⇒ Object
Allows you to pass a whole block to configure the Kharon module.
19 20 21 |
# File 'lib/validator_factory.rb', line 19 def self.configure(&block) self.instance_eval(&block) end |
.use_exceptions(status) ⇒ Object
Sets the use of exceptions in the whole process.
25 26 27 |
# File 'lib/validator_factory.rb', line 25 def self.use_exceptions(status) @@use_exceptions = status end |
.uses_exceptions? ⇒ Boolean
Fancy method to know if the module uses the exceptions or not.
30 31 32 |
# File 'lib/validator_factory.rb', line 30 def self.uses_exceptions? return @@use_exceptions end |