Sha256: 68e361754fd9923b6c09bcc0d002f71ffb3420a1ca310f8b7e29d87c8a808c48

Contents?: true

Size: 280 Bytes

Versions: 14

Compression:

Stored size: 280 Bytes

Contents

class Hash

  # Generate params string based on hash content
  #   {'--param': 'value', '-a': nil, '--config': 'path/to/config'}.to_params
  #   # "--param value -a --config path/to/config"
  def to_params
    return '' if self.empty?
    self.flatten.compact.join(' ')
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
buildable-2.4.1 lib/core_ext/hash.rb
buildable-2.4.0 lib/core_ext/hash.rb
buildable-2.3.0 lib/core_ext/hash.rb
buildable-2.1.6 lib/core_ext/hash.rb
buildable-2.1.5 lib/core_ext/hash.rb
buildable-2.1.4 lib/core_ext/hash.rb
buildable-2.1.3 lib/core_ext/hash.rb
buildable-2.2.0 lib/core_ext/hash.rb
buildable-2.1.2 lib/core_ext/hash.rb
buildable-2.1.1 lib/core_ext/hash.rb
buildable-2.1.0 lib/core_ext/hash.rb
buildable-2.0.0 lib/core_ext/hash.rb
buildable-1.4.2 lib/core_ext/hash.rb
buildable-1.3.4 lib/core_ext/hash.rb