Exception: StringValidator::Error
- Inherits:
-
StandardError
- Object
- StandardError
- StringValidator::Error
- Defined in:
- lib/stringvalidator.rb
Overview
エラーの基底クラス
Direct Known Subclasses
InvalidLength, InvalidValue, NotFloat, NotInteger, OutOfRange, RegexpMismatch, TooLong, TooShort
Defined Under Namespace
Classes: InvalidLength, InvalidValue, NotFloat, NotInteger, OutOfRange, RegexpMismatch, TooLong, TooShort
Instance Attribute Summary collapse
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value = nil, rule = nil) ⇒ Error
constructor
- value
- 対象文字列 rule
-
ルールオブジェクト.
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
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
70 71 72 |
# File 'lib/stringvalidator.rb', line 70 def rule @rule end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
70 71 72 |
# File 'lib/stringvalidator.rb', line 70 def value @value end |
Class Method Details
.errmsg ⇒ Object
72 73 74 |
# File 'lib/stringvalidator.rb', line 72 def self.errmsg() @errmsg end |