Sha256: e7076d054e4d70834009d8b16d3406b81062a9a87adb2981f1ef57185c53cbc5
Contents?: true
Size: 711 Bytes
Versions: 1
Compression:
Stored size: 711 Bytes
Contents
# frozen_string_literal: true # reference: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/inflector/methods.rb module Cmdlet # Array handling routines, eg. join, join_prefix, join_post module Array # Join: join an array of values with separator as a string class Join < Funcky::BaseFunction # # @param [String|Int] value - numeric value # @return [String] ordinal suffix that would be required for a number def parse(value) return '' if value.nil? || !value.is_a?(Array) values = value.reject(&:blank?) return '' if value.length.zero? separator = ',' values.join(separator) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cmdlet-0.0.7 | lib/cmdlet/array/join.rb |