Sha256: cf606bfce4c631cf28d6b04fac842b3e7863949325d6c1f9870fcc8945c263b1
Contents?: true
Size: 499 Bytes
Versions: 26
Compression:
Stored size: 499 Bytes
Contents
# frozen_string_literal: true module Marameters # Builds a method's parameter signature. class Signature def initialize parameters, builder: Builder.new @parameters = parameters @builder = builder end def to_s = build.join ", " alias to_str to_s private attr_reader :parameters, :builder def build parameters.reduce [] do |signature, (kind, (name, default))| signature << builder.call(kind, name, default:) end end end end
Version data entries
26 entries across 26 versions & 1 rubygems