Class: Kangaru::Validation::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/kangaru/validation/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute:, message:) ⇒ Error

Returns a new instance of Error.



8
9
10
11
# File 'lib/kangaru/validation/error.rb', line 8

def initialize(attribute:, message:)
  @attribute = attribute
  @message = message
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



6
7
8
# File 'lib/kangaru/validation/error.rb', line 6

def attribute
  @attribute
end

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/kangaru/validation/error.rb', line 6

def message
  @message
end

Instance Method Details

#full_messageObject



13
14
15
# File 'lib/kangaru/validation/error.rb', line 13

def full_message
  [human_attribute, message].join(" ")
end