Class: Tengine::Core::Validation::Definition
- Inherits:
-
Object
- Object
- Tengine::Core::Validation::Definition
- Defined in:
- lib/tengine/core/validation.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
Instance Method Summary collapse
-
#initialize(format, description) ⇒ Definition
constructor
A new instance of Definition.
- #message ⇒ Object
- #options ⇒ Object
Constructor Details
#initialize(format, description) ⇒ Definition
Returns a new instance of Definition.
8 9 10 |
# File 'lib/tengine/core/validation.rb', line 8 def initialize(format, description) @format, @description = format.freeze, description.freeze end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/tengine/core/validation.rb', line 7 def description @description end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
7 8 9 |
# File 'lib/tengine/core/validation.rb', line 7 def format @format end |
Instance Method Details
#message ⇒ Object
11 12 13 |
# File 'lib/tengine/core/validation.rb', line 11 def "は#{description}でなければなりません" end |
#options ⇒ Object
14 15 16 |
# File 'lib/tengine/core/validation.rb', line 14 def {:with => format, :message => } end |