Exception: StringValidator::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/stringvalidator.rb

Overview

エラーの基底クラス

Defined Under Namespace

Classes: InvalidLength, InvalidValue, NotFloat, NotInteger, OutOfRange, RegexpMismatch, TooLong, TooShort

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value = nil, rule = nil) ⇒ Error

value

対象文字列

rule

ルールオブジェクト



65
66
67
68
69
# File 'lib/stringvalidator.rb', line 65

def initialize(value=nil, rule=nil)
  @rule = rule
  @value = value
  super self.class.errmsg
end

Instance Attribute Details

#ruleObject (readonly)

Returns the value of attribute rule.



70
71
72
# File 'lib/stringvalidator.rb', line 70

def rule
  @rule
end

#valueObject (readonly)

Returns the value of attribute value.



70
71
72
# File 'lib/stringvalidator.rb', line 70

def value
  @value
end

Class Method Details

.errmsgObject



72
73
74
# File 'lib/stringvalidator.rb', line 72

def self.errmsg()
  @errmsg
end