Class: Fragmenter::Validators::ImageValidator
- Inherits:
-
Object
- Object
- Fragmenter::Validators::ImageValidator
- Defined in:
- lib/fragmenter/validators/image_validator.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
-
#initialize(request) ⇒ ImageValidator
constructor
A new instance of ImageValidator.
- #part? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize(request) ⇒ ImageValidator
Returns a new instance of ImageValidator.
6 7 8 9 |
# File 'lib/fragmenter/validators/image_validator.rb', line 6 def initialize(request) @request = request @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
4 5 6 |
# File 'lib/fragmenter/validators/image_validator.rb', line 4 def errors @errors end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
4 5 6 |
# File 'lib/fragmenter/validators/image_validator.rb', line 4 def request @request end |
Instance Method Details
#part? ⇒ Boolean
11 12 13 |
# File 'lib/fragmenter/validators/image_validator.rb', line 11 def part? false end |
#valid? ⇒ Boolean
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fragmenter/validators/image_validator.rb', line 15 def valid? return true unless fragmenter.complete? identifiable = identifiable? unless identifiable errors << 'Rebuilt fragments are not a valid image' end identifiable end |