Class: MetadataPresenter::ValidateAnswers
- Inherits:
-
Object
- Object
- MetadataPresenter::ValidateAnswers
- Defined in:
- app/validators/metadata_presenter/validate_answers.rb
Instance Attribute Summary collapse
-
#autocomplete_items ⇒ Object
readonly
Returns the value of attribute autocomplete_items.
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#page_answers ⇒ Object
readonly
Returns the value of attribute page_answers.
Instance Method Summary collapse
-
#initialize(page_answers, components:, autocomplete_items:) ⇒ ValidateAnswers
constructor
A new instance of ValidateAnswers.
- #invalid? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize(page_answers, components:, autocomplete_items:) ⇒ ValidateAnswers
Returns a new instance of ValidateAnswers.
5 6 7 8 9 |
# File 'app/validators/metadata_presenter/validate_answers.rb', line 5 def initialize(page_answers, components:, autocomplete_items:) @page_answers = page_answers @components = Array(components) @autocomplete_items = autocomplete_items end |
Instance Attribute Details
#autocomplete_items ⇒ Object (readonly)
Returns the value of attribute autocomplete_items.
3 4 5 |
# File 'app/validators/metadata_presenter/validate_answers.rb', line 3 def autocomplete_items @autocomplete_items end |
#components ⇒ Object (readonly)
Returns the value of attribute components.
3 4 5 |
# File 'app/validators/metadata_presenter/validate_answers.rb', line 3 def components @components end |
#page_answers ⇒ Object (readonly)
Returns the value of attribute page_answers.
3 4 5 |
# File 'app/validators/metadata_presenter/validate_answers.rb', line 3 def page_answers @page_answers end |
Instance Method Details
#invalid? ⇒ Boolean
15 16 17 |
# File 'app/validators/metadata_presenter/validate_answers.rb', line 15 def invalid? !valid? end |
#valid? ⇒ Boolean
11 12 13 |
# File 'app/validators/metadata_presenter/validate_answers.rb', line 11 def valid? validators.map(&:valid?).all? end |