Method: Contrast::Components::ComponentBase#stringify_array

Defined in:
lib/contrast/components/base.rb

#stringify_array(val, join_char = ',') ⇒ String, Object

attempts to stringifys the config value if it is an array with the join char

Parameters:

  • val (Object)

    val to stringify

  • join_char (String, ',') (defaults to: ',')

    join character defaults to ‘,’

Returns:

  • (String, Object)

    the stringified val or the object as is



96
97
98
99
100
# File 'lib/contrast/components/base.rb', line 96

def stringify_array val, join_char = ','
  return val.join(join_char) if val.cs__is_a?(Array)

  val
end