Class: Parametric::Policies::MultiplePolicy

Inherits:
Policy
  • Object
show all
Defined in:
lib/parametric/policies.rb

Constant Summary collapse

OPTION_SEPARATOR =
/\s*,\s*/.freeze

Instance Method Summary collapse

Methods inherited from Policy

#initialize, #wrap

Constructor Details

This class inherits a constructor from Parametric::Policies::Policy

Instance Method Details

#valueObject



32
33
34
35
36
# File 'lib/parametric/policies.rb', line 32

def value
  decorated.value.map do |v|
    v.is_a?(String) ? v.split(options.fetch(:separator, OPTION_SEPARATOR)) : v
  end.flatten
end