Class: Wings::ReflectionIdValue

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)


57
58
59
# File 'lib/wings/converter_value_mapper.rb', line 57

def self.handles?(value)
  value.first.to_s.end_with?('_id')
end

Instance Method Details

#resultObject



61
62
63
64
65
# File 'lib/wings/converter_value_mapper.rb', line 61

def result
  return nil if value.last.blank?

  [value.first, value.last.to_s]
end