lib/peeky/parameter_info.rb
# Convert the limited information provided by ruby method.parameters
# to a richer structure.
# rubocop:disable Metrics/CyclomaticComplexity
Convert the limited information provided by ruby method.parameters
to a richer structure.
Convert the limited information provided by ruby method . parameters to a richer structure .
def map(param)
      @name = param.length > 1 ? param[1].to_s : ''
      @default_value = nil
      case param[0]
      when :req
        @type = :param_required
      when :opt
        @type = :param_optional
      when :rest
        @type = :splat
      when :keyreq
        @type = :key_required
      when :key
        @type = :key_optional
      when :keyrest
        @type = :double_splat
      when :block
        @type = :block
      else
        raise 'unknown type'
      end
    end
def map ( param ) @name = param . length > 1 ? param [ 1 ] . to_s : '' @default_value = nil case param [ 0 ] when :req @type = :param_required when :opt @type = :param_optional when :rest @type = :splat when :keyreq @type = :key_required when :key @type = :key_optional when :keyrest @type = :double_splat when :block @type = :block else raise 'unknown type' end end
Convert the limited information provided by ruby method.parameters
to a richer structure.
Convert the limited information provided by ruby method . parameters to a richer structure .
param
<not_specific>