Sha256: 68f055e8c8d361c7275668a274fcbc725fdce9ff4c9516b45d9a6a1a5ea2900a
Contents?: true
Size: 501 Bytes
Versions: 57
Compression:
Stored size: 501 Bytes
Contents
# frozen_string_literal: true class Code class Type class Maybe < Type attr_reader :clazz def initialize(clazz) @clazz = clazz end def valid?(argument) !argument || argument.is_a?(Object::Nothing) || valid_for?(expected: clazz, actual: argument) end def min_arguments 0 end def max_arguments max_arguments_of(clazz) end def name "#{clazz.name}.maybe" end end end end
Version data entries
57 entries across 57 versions & 1 rubygems