Class: Nemo::MetaObject::ValidationError

Inherits:
Object
  • Object
show all
Defined in:
lib/nemo/metaobject/validation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(a, error_string) ⇒ ValidationError

Returns a new instance of ValidationError.



5
6
7
8
# File 'lib/nemo/metaobject/validation.rb', line 5

def initialize(a, error_string)
  @attribute = a
  @error_string = error_string
end

Instance Attribute Details

#attributeObject

Returns the value of attribute attribute.



3
4
5
# File 'lib/nemo/metaobject/validation.rb', line 3

def attribute
  @attribute
end

#error_stringObject

Returns the value of attribute error_string.



3
4
5
# File 'lib/nemo/metaobject/validation.rb', line 3

def error_string
  @error_string
end

Instance Method Details

#to_sObject



10
11
12
# File 'lib/nemo/metaobject/validation.rb', line 10

def to_s
  sprintf('%s: %s', @attribute.label, @error_string)
end