Class: Formulario::Field::ExceptionalValue
Constant Summary
TYPES
Instance Attribute Summary collapse
#raw_value
Class Method Summary
collapse
Instance Method Summary
collapse
#==, #blank?, default, #to_s, type_for, #value
Instance Attribute Details
#reasons ⇒ Object
Returns the value of attribute reasons.
6
7
8
|
# File 'lib/formulario/fields/exceptional_value.rb', line 6
def reasons
@reasons
end
|
Class Method Details
.for(raw_value, reasons: Undefined) ⇒ Object
8
9
10
|
# File 'lib/formulario/fields/exceptional_value.rb', line 8
def self.for(raw_value, reasons: Undefined)
new(raw_value, reasons: reasons)
end
|
Instance Method Details
#each(&block) ⇒ Object
24
25
26
|
# File 'lib/formulario/fields/exceptional_value.rb', line 24
def each(&block)
reasons.each(&block)
end
|
#exceptional? ⇒ Boolean
12
13
14
|
# File 'lib/formulario/fields/exceptional_value.rb', line 12
def exceptional?
true
end
|
#exceptional_class ⇒ Object
28
29
30
|
# File 'lib/formulario/fields/exceptional_value.rb', line 28
def exceptional_class
self.class
end
|
#inspect ⇒ Object
16
17
18
|
# File 'lib/formulario/fields/exceptional_value.rb', line 16
def inspect
"#{self.class}[#{value} (#{reasons.join(' | ')})]"
end
|
#to_a ⇒ Object
20
21
22
|
# File 'lib/formulario/fields/exceptional_value.rb', line 20
def to_a
reasons
end
|