Class: Lore::Validation::Reason
- Inherits:
-
Object
- Object
- Lore::Validation::Reason
- Defined in:
- lib/lore/validation/reason.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
-
.of_exception(excep) ⇒ Object
System exception:.
-
.of_invalid_parameters(ikp) ⇒ Object
Parameter validation failed:.
-
.of_user_runtime_error(excep) ⇒ Object
System exception:.
Instance Method Summary collapse
-
#initialize(message, options) ⇒ Reason
constructor
{{{.
- #message ⇒ Object
Constructor Details
#initialize(message, options) ⇒ Reason
{{{
17 18 19 20 |
# File 'lib/lore/validation/reason.rb', line 17 def initialize(, ) # {{{ @message = @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/lore/validation/reason.rb', line 11 def @options end |
Class Method Details
.of_exception(excep) ⇒ Object
System exception:
41 42 43 44 45 46 47 |
# File 'lib/lore/validation/reason.rb', line 41 def self.of_exception(excep) # {{{ = [:choice_critical, :choice_recommended] = excep. + ': ' + excep.backtrace.join('<br />') return self.new(, ) end |
.of_invalid_parameters(ikp) ⇒ Object
Parameter validation failed:
23 24 25 26 27 28 29 |
# File 'lib/lore/validation/reason.rb', line 23 def self.of_invalid_parameters(ikp) # {{{ = Lore::Validation::Error_Message.(ikp.serialize()) @logger.debug('Reason message: '+.inspect) return self.new(, @options) end |
.of_user_runtime_error(excep) ⇒ Object
System exception:
32 33 34 35 36 37 38 |
# File 'lib/lore/validation/reason.rb', line 32 def self.of_user_runtime_error(excep) # {{{ = [:choice_critical, :choice_recommended] = Lang[excep.] return self.new(, ) end |
Instance Method Details
#message ⇒ Object
13 14 15 |
# File 'lib/lore/validation/reason.rb', line 13 def () @message end |