Sha256: 24572bb5488f2be4ef834744ba59e11f5a0c261fbbcbe39b06683e97bf0bfdd6

Contents?: true

Size: 241 Bytes

Versions: 5

Compression:

Stored size: 241 Bytes

Contents

module Polytrix
  class Challenges < Hash
    def get(regex)
      _, v = find do |k, _|
        regex.match k
      end
      v
    end

    def get_all(regex)
      select do |k, _|
        regex.match k
      end.values
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
polytrix-0.1.4 lib/polytrix/challenges.rb
polytrix-0.1.3 lib/polytrix/challenges.rb
polytrix-0.1.2 lib/polytrix/challenges.rb
polytrix-0.1.1 lib/polytrix/challenges.rb
polytrix-0.1.0 lib/polytrix/challenges.rb