Class: Kangaru::Validation::Error
- Inherits:
-
Object
- Object
- Kangaru::Validation::Error
- Defined in:
- lib/kangaru/validation/error.rb
Constant Summary collapse
- MESSAGES =
{ blank: "can't be blank" }.freeze
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #full_message ⇒ Object
-
#initialize(attribute:, type:) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(attribute:, type:) ⇒ Error
Returns a new instance of Error.
12 13 14 15 |
# File 'lib/kangaru/validation/error.rb', line 12 def initialize(attribute:, type:) @attribute = attribute @type = type end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
10 11 12 |
# File 'lib/kangaru/validation/error.rb', line 10 def attribute @attribute end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/kangaru/validation/error.rb', line 10 def type @type end |
Instance Method Details
#full_message ⇒ Object
17 18 19 |
# File 'lib/kangaru/validation/error.rb', line 17 def [human_attribute, ].join(" ") end |