Skip to content

struct Crystal::TypeFilters
inherits Struct

Class methods

.and(filters1, filters2)

View source

.assign_var(filters, target)

If we have

if a = b ... end

then a and b must have the same truthiness. Thus we can strengthen the negation of the condition from !a || !b to !a && !b, which usually provides a stricter filter.

View source

.not(filters)

View source

.or(filters1, filters2)

View source

.truthy(node)

View source

.new(node, filter)

View source

Methods

#dup

Returns a shallow copy of this object.

Because Value is a value type, this method returns self, which already involves a shallow copy of this object because value types are passed by value.

View source

#each

View source