Class: LiquidValidator::Validator
- Inherits:
-
Object
- Object
- LiquidValidator::Validator
- Defined in:
- lib/liquid-validator/validator.rb
Instance Attribute Summary collapse
-
#error_mode ⇒ Object
readonly
Returns the value of attribute error_mode.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
-
#initialize(template, error_mode: :strict) ⇒ Validator
constructor
A new instance of Validator.
- #valid? ⇒ Boolean
Constructor Details
#initialize(template, error_mode: :strict) ⇒ Validator
Returns a new instance of Validator.
4 5 6 7 8 9 10 |
# File 'lib/liquid-validator/validator.rb', line 4 def initialize(template, error_mode: :strict) @template = template @error_mode = error_mode @errors = [] @valid = true run_validations_on_template end |
Instance Attribute Details
#error_mode ⇒ Object (readonly)
Returns the value of attribute error_mode.
2 3 4 |
# File 'lib/liquid-validator/validator.rb', line 2 def error_mode @error_mode end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
2 3 4 |
# File 'lib/liquid-validator/validator.rb', line 2 def errors @errors end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
2 3 4 |
# File 'lib/liquid-validator/validator.rb', line 2 def template @template end |
Instance Method Details
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/liquid-validator/validator.rb', line 12 def valid? @valid end |