Class: Wings::ArrayValue

Inherits:
Valkyrie::ValueMapper
  • Object
show all
Defined in:
lib/wings/converter_value_mapper.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.handles?(value) ⇒ Boolean

Returns:

  • (Boolean)

216
217
218
# File 'lib/wings/converter_value_mapper.rb', line 216

def self.handles?(value)
  value.last.is_a?(Array)
end

Instance Method Details

#resultObject


220
221
222
# File 'lib/wings/converter_value_mapper.rb', line 220

def result
  [value.first, values]
end

#valuesObject


224
225
226
227
228
# File 'lib/wings/converter_value_mapper.rb', line 224

def values
  value.last.map do |val|
    calling_mapper.for([value.first, val]).result
  end.flat_map(&:last)
end