Class: Dragnet::Validators::Entities::TestRecordValidator
- Inherits:
-
Object
- Object
- Dragnet::Validators::Entities::TestRecordValidator
- Defined in:
- lib/dragnet/validators/entities/test_record_validator.rb
Overview
Validates a MTR object
Instance Attribute Summary collapse
-
#test_record ⇒ Object
readonly
Returns the value of attribute test_record.
Instance Method Summary collapse
-
#initialize(test_record) ⇒ TestRecordValidator
constructor
Creates a new instance of the class.
-
#validate ⇒ Object
Validates the given test record.
Constructor Details
#initialize(test_record) ⇒ TestRecordValidator
Creates a new instance of the class.
22 23 24 |
# File 'lib/dragnet/validators/entities/test_record_validator.rb', line 22 def initialize(test_record) @test_record = test_record end |
Instance Attribute Details
#test_record ⇒ Object (readonly)
Returns the value of attribute test_record.
18 19 20 |
# File 'lib/dragnet/validators/entities/test_record_validator.rb', line 18 def test_record @test_record end |
Instance Method Details
#validate ⇒ Object
Validates the given test record
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/dragnet/validators/entities/test_record_validator.rb', line 28 def validate repos_xor_files repos_xor_sha1 Dragnet::Validators::Fields::IDValidator.new.validate('id', test_record.id) Dragnet::Validators::Fields::DescriptionValidator.new.validate('description', test_record.description) test_record.files = Dragnet::Validators::Fields::FilesValidator.new.validate('files', test_record.files) test_record.result = Dragnet::Validators::Fields::ResultValidator.new.validate('result', test_record.result) end |