class Inspector::Constraints::Valid
Public Class Methods
new(*args)
click to toggle source
# File lib/inspector/constraints/valid.rb, line 6 def initialize(*args) if args.length == 1 @use_custom_type = true @type = args.first end end
Public Instance Methods
inspect()
click to toggle source
# File lib/inspector/constraints/valid.rb, line 26 def inspect "#<valid%{type}>" % { :type => " #{@type}".rstrip } end
to_s()
click to toggle source
# File lib/inspector/constraints/valid.rb, line 22 def to_s "validate" end
validate_as(value)
click to toggle source
# File lib/inspector/constraints/valid.rb, line 13 def validate_as(value) return @type if @use_custom_type value.class end
validator()
click to toggle source
# File lib/inspector/constraints/valid.rb, line 18 def validator :validity end