Class: Seedie::FieldValues::ValueTemplateValidator
- Inherits:
-
Object
- Object
- Seedie::FieldValues::ValueTemplateValidator
- Defined in:
- lib/seedie/field_values/value_template_validator.rb
Constant Summary collapse
- VALID_KEYS =
%w[values value options].freeze
- PICK_STRATEGIES =
%w[random sequential].freeze
Instance Method Summary collapse
-
#initialize(value_template, index, name) ⇒ ValueTemplateValidator
constructor
A new instance of ValueTemplateValidator.
- #validate ⇒ Object
Constructor Details
#initialize(value_template, index, name) ⇒ ValueTemplateValidator
Returns a new instance of ValueTemplateValidator.
9 10 11 12 13 |
# File 'lib/seedie/field_values/value_template_validator.rb', line 9 def initialize(value_template, index, name) @value_template = value_template @index = index @name = name end |
Instance Method Details
#validate ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/seedie/field_values/value_template_validator.rb', line 15 def validate return unless @value_template.is_a?(Hash) validate_keys validate_values if @value_template.key?("values") if @value_template.key?("options") end |