A library of utility services and concerns.
Immutable empty object used to represent undefined method parameters.
Use an instance of Undefined as a value object to distinguish between an optional method parameter that is passed a nil value from a method parameter that is not passed.
UNDEFINED = Undefined.new
private_constant :UNDEFINED
def parameter_passed?(parameter = UNDEFINED)
parameter != UNDEFINED
end
parameter_passed? #=> false
parameter_passed?(nil) #=> true#inspect => String
#instance_of?(mod) => true, false
#is_a?(mod) => true, false
Also known as:
kind_of?
Back to Documentation | Reference | SleepingKingStudios | SleepingKingStudios::Tools