lib/formulario/fields/exceptional_value.rb in formulario-0.1.6 vs lib/formulario/fields/exceptional_value.rb in formulario-0.1.8

- old
+ new

@@ -7,11 +7,10 @@ def self.for(raw_value, reasons: Undefined) new(raw_value, reasons: reasons) end - def exceptional? true end def inspect @@ -24,10 +23,14 @@ def each(&block) reasons.each(&block) end + def exceptional_class + self.class + end + private def initialize(raw_value, reasons: Undefined) the_reasons = reasons == Undefined ? ["is invalid"] : Array(reasons) @@ -41,9 +44,8 @@ @reasons = new_reasons super(value) end - end end end