File: size.rb

package info (click to toggle)
puppet-agent 8.10.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,404 kB
  • sloc: ruby: 286,820; sh: 492; xml: 116; makefile: 88; cs: 68
file content (15 lines) | stat: -rw-r--r-- 361 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

# The same as length() - returns the size of an Array, Hash, String, or Binary value.
#
# @since 6.0.0 - also supporting Binary
#
Puppet::Functions.create_function(:size) do
  dispatch :generic_size do
    param 'Variant[Collection, String, Binary]', :arg
  end

  def generic_size(arg)
    call_function('length', arg)
  end
end