class Shoulda::Matchers::ActiveModel::RequireAValidSubnetMatcher
Public Instance Methods
description()
click to toggle source
# File lib/validates_host/require_a_valid_subnet_matcher.rb, line 13 def description "require #{@attribute} to be a valid subnet" end
matches?(subject)
click to toggle source
Calls superclass method
# File lib/validates_host/require_a_valid_subnet_matcher.rb, line 17 def matches?(subject) super(subject) disallows_invalid_value && allows_valid_value end
Private Instance Methods
allows_valid_value()
click to toggle source
# File lib/validates_host/require_a_valid_subnet_matcher.rb, line 29 def allows_valid_value allows_value_of('10.10.10.1/28') end
disallows_invalid_value()
click to toggle source
# File lib/validates_host/require_a_valid_subnet_matcher.rb, line 25 def disallows_invalid_value disallows_value_of('10.0.0') end