Module: Shoulda::Matchers::ActiveModel

Defined in:
lib/validates_host/shoulda-matchers/ip_matcher.rb,
lib/validates_host/shoulda-matchers/subnet_matcher.rb,
lib/validates_host/shoulda-matchers/host_name_matcher.rb,
lib/validates_host/shoulda-matchers/domain_name_matcher.rb

Defined Under Namespace

Classes: DomainNameMatcher, HostNameMatcher, IpMatcher, SubnetMatcher

Instance Method Summary collapse

Instance Method Details

#require_a_valid_domain_name(attribute = :domain_name) ⇒ Object



6
7
8
# File 'lib/validates_host/shoulda-matchers/domain_name_matcher.rb', line 6

def require_a_valid_domain_name(attribute = :domain_name)
  DomainNameMatcher.new(attribute)
end

#require_a_valid_host_name(attribute = :host_name) ⇒ Object



6
7
8
# File 'lib/validates_host/shoulda-matchers/host_name_matcher.rb', line 6

def require_a_valid_host_name(attribute = :host_name)
  HostNameMatcher.new(attribute)
end

#require_a_valid_ip(attribute = :ip) ⇒ Object



6
7
8
# File 'lib/validates_host/shoulda-matchers/ip_matcher.rb', line 6

def require_a_valid_ip(attribute = :ip)
  IpMatcher.new(attribute)
end

#require_a_valid_subnet(attribute = :value) ⇒ Object



6
7
8
# File 'lib/validates_host/shoulda-matchers/subnet_matcher.rb', line 6

def require_a_valid_subnet(attribute = :value)
  SubnetMatcher.new(attribute)
end