Class: Hermod::Validators::AllowedValues

Inherits:
Base
  • Object
show all
Defined in:
lib/hermod/validators/allowed_values.rb

Overview

Checks the given value is in a predefined list of allowed values

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes, #value

Instance Method Summary collapse

Methods inherited from Base

#valid?

Constructor Details

#initialize(allowed_values) ⇒ AllowedValues

Sets up the validator with the list of allowed values



10
11
12
# File 'lib/hermod/validators/allowed_values.rb', line 10

def initialize(allowed_values)
  @allowed_values = allowed_values
end

Instance Attribute Details

#allowed_valuesObject (readonly)

Returns the value of attribute allowed_values.



7
8
9
# File 'lib/hermod/validators/allowed_values.rb', line 7

def allowed_values
  @allowed_values
end