class Hermod::Validators::Attributes
Checks the attributes are in a list of allowed attributes
Attributes
allowed_attributes[R]
bad_attributes[R]
Public Class Methods
new(allowed_attributes)
click to toggle source
Public: Sets up the list of allowed attributes
# File lib/hermod/validators/attributes.rb, line 10 def initialize(allowed_attributes) @allowed_attributes = allowed_attributes end
Private Instance Methods
message(value, attributes)
click to toggle source
# File lib/hermod/validators/attributes.rb, line 26 def message(value, attributes) "has attributes it doesn't accept: #{bad_attributes(attributes).to_sentence}" end
test(value, attributes)
click to toggle source
# File lib/hermod/validators/attributes.rb, line 22 def test(value, attributes) bad_attributes(attributes) == [] end