Class: TorqueBox::Configuration::Validator Private
- Inherits:
-
Object
- Object
- TorqueBox::Configuration::Validator
- Defined in:
- lib/torquebox/configuration/validator.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#initialize(ruleset, entry, options_to_validate) ⇒ Validator
constructor
private
A new instance of Validator.
- #message ⇒ Object private
- #valid? ⇒ Boolean private
Constructor Details
#initialize(ruleset, entry, options_to_validate) ⇒ Validator
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Validator.
25 26 27 28 29 30 31 |
# File 'lib/torquebox/configuration/validator.rb', line 25 def initialize(ruleset, entry, ) @required = ruleset[:required] || [] @allowed = @required + (ruleset[:optional] || []) @entry = entry @options_to_validate = validate end |
Instance Method Details
#message ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/torquebox/configuration/validator.rb', line 38 def case .size when 0 nil when 1 .first else result = "There are multiple messages for this entry:" .each { || result << "\n " << } result end end |
#valid? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 |
# File 'lib/torquebox/configuration/validator.rb', line 34 def valid? ! end |