class J2119::DoesNotHaveFieldConstraint
Verify node does not have the named field
Public Class Methods
new(name)
click to toggle source
Calls superclass method
J2119::Constraint::new
# File lib/j2119/constraints.rb, line 109 def initialize(name) super() @name = name end
Public Instance Methods
check(node, path, problems)
click to toggle source
# File lib/j2119/constraints.rb, line 119 def check(node, path, problems) if node[@name] problems << "#{path} has forbidden field \"#{@name}\"" end end
to_s()
click to toggle source
# File lib/j2119/constraints.rb, line 114 def to_s conds = (@conditions.empty?) ? '' : " #{@conditions.size} conditions" "<Field #{@name} should be absent#{conds}>" end