Sha256: 22d8a081461521ee58a9727fe1caaaa63effcd47cbfa2b51bd5f72193dfc30bb

Contents?: true

Size: 268 Bytes

Versions: 1

Compression:

Stored size: 268 Bytes

Contents

# frozen_string_literal: true

class Symbol
  def clamped(whitelist, strict: true)
    is_included = proc do |item|
      if strict
        item == self
      else
        item.to_sym == self
      end
    end

    return self if whitelist.any?(is_included)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
clamped-0.1.0 lib/clamped/symbol.rb