Class: Suretax::Concerns::Validatable::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/suretax/concerns/validatable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute, value) ⇒ Error

Returns a new instance of Error.



25
26
27
28
29
# File 'lib/suretax/concerns/validatable.rb', line 25

def initialize(attribute, value)
  self.value     = value
  self.attribute = attribute
  self.message   = "Invalid #{attribute}: #{reason}"
end

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute.



23
24
25
# File 'lib/suretax/concerns/validatable.rb', line 23

def attribute
  @attribute
end

#messageObject

Returns the value of attribute message.



23
24
25
# File 'lib/suretax/concerns/validatable.rb', line 23

def message
  @message
end

#valueObject

Returns the value of attribute value.



23
24
25
# File 'lib/suretax/concerns/validatable.rb', line 23

def value
  @value
end