Class: Jsus::Util::Validator::Base
- Inherits:
-
Object
- Object
- Jsus::Util::Validator::Base
- Includes:
- Mixins::OperatesOnSources
- Defined in:
- lib/jsus/util/validator/base.rb
Direct Known Subclasses
Class Method Summary collapse
-
.validate(*args) ⇒ Object
Shortcut for creating and validating a list of items.
Instance Method Summary collapse
-
#initialize(pool_or_array_or_container = []) ⇒ Base
constructor
Constructor accepts pool or array or container and adds every file to its source files set.
-
#validate ⇒ Boolean
Whether or not given sources conform to given set of rules.
-
#validation_errors ⇒ Array
List of validation errors.
Methods included from Mixins::OperatesOnSources
Constructor Details
#initialize(pool_or_array_or_container = []) ⇒ Base
Constructor accepts pool or array or container and adds every file to its source files set.
12 13 14 |
# File 'lib/jsus/util/validator/base.rb', line 12 def initialize(pool_or_array_or_container = []) self.source_files = pool_or_array_or_container end |
Class Method Details
.validate(*args) ⇒ Object
Shortcut for creating and validating a list of items
31 32 33 |
# File 'lib/jsus/util/validator/base.rb', line 31 def self.validate(*args) new(*args).validate end |
Instance Method Details
#validate ⇒ Boolean
Returns whether or not given sources conform to given set of rules.
18 19 20 |
# File 'lib/jsus/util/validator/base.rb', line 18 def validate validation_errors.empty? end |
#validation_errors ⇒ Array
Returns list of validation errors.
24 25 26 |
# File 'lib/jsus/util/validator/base.rb', line 24 def validation_errors [] end |