Class: MVCLI::Form::Input::ListTarget
- Includes:
- ActiveSupport::Inflector
- Defined in:
- lib/mvcli/form/input.rb
Instance Method Summary collapse
Methods inherited from Target
#decode, #default, #initialize
Constructor Details
This class inherits a constructor from MVCLI::Form::Input::Target
Instance Method Details
#value(source, context = nil) ⇒ Object
63 64 65 66 67 68 69 |
# File 'lib/mvcli/form/input.rb', line 63 def value(source, context = nil) source = Map(source) list = [source[singularize @name]].compact.flatten.map do |value| super({@name => value}, context) end.compact list.empty? ? [default(context)].compact.flatten : list end |