Class: Formulario::Field::Collection
Constant Summary
TYPES
Instance Attribute Summary
#raw_value
Class Method Summary
collapse
Instance Method Summary
collapse
#==, #blank?, default, #exceptional_class, for, #inspect, #to_s, type_for, #value
Class Method Details
.[](type) ⇒ Object
6
7
8
9
10
|
# File 'lib/formulario/fields/collection.rb', line 6
def self.[](type)
Class.new(self).tap { |typed_class|
typed_class.fields_type = type
}
end
|
Instance Method Details
#each(&block) ⇒ Object
20
21
22
|
# File 'lib/formulario/fields/collection.rb', line 20
def each(&block)
fields.each(&block)
end
|
#exceptional? ⇒ Boolean
16
17
18
|
# File 'lib/formulario/fields/collection.rb', line 16
def exceptional?
fields.any?(&:exceptional?)
end
|
#fields ⇒ Object
12
13
14
|
# File 'lib/formulario/fields/collection.rb', line 12
def fields
raw_value
end
|
#values ⇒ Object
24
25
26
|
# File 'lib/formulario/fields/collection.rb', line 24
def values
map(&:value)
end
|