Sha256: c2a6ee82a1f1439ae92479674df2e1af2ac10cff3463c7c9da1c2562b37844b1

Contents?: true

Size: 308 Bytes

Versions: 24

Compression:

Stored size: 308 Bytes

Contents

require 'forwardable'

module Dragonfly
  class Whitelist
    extend Forwardable
    def_delegators :patterns, :push

    def initialize(patterns=[])
      @patterns = patterns
    end

    attr_reader :patterns

    def include?(string)
      patterns.any?{|pattern| pattern === string }
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
dragonfly-1.4.1 lib/dragonfly/whitelist.rb
dragonfly-1.4.0 lib/dragonfly/whitelist.rb
dragonfly-1.3.0 lib/dragonfly/whitelist.rb
dragonfly-1.2.1 lib/dragonfly/whitelist.rb
dragonfly-1.2.0 lib/dragonfly/whitelist.rb
dragonfly-1.1.5 lib/dragonfly/whitelist.rb
dragonfly-1.1.4 lib/dragonfly/whitelist.rb
dragonfly-1.1.3 lib/dragonfly/whitelist.rb
dragonfly-1.1.2 lib/dragonfly/whitelist.rb
dragonfly-1.1.1 lib/dragonfly/whitelist.rb
dragonfly-1.1.0 lib/dragonfly/whitelist.rb
dragonfly-1.0.12 lib/dragonfly/whitelist.rb
dragonfly-1.0.11 lib/dragonfly/whitelist.rb
dragonfly-1.0.10 lib/dragonfly/whitelist.rb
dragonfly-1.0.9 lib/dragonfly/whitelist.rb
dragonfly-1.0.8 lib/dragonfly/whitelist.rb
dragonfly-1.0.7 lib/dragonfly/whitelist.rb
dragonfly-1.0.6 lib/dragonfly/whitelist.rb
dragonfly-1.0.5 lib/dragonfly/whitelist.rb
dragonfly-1.0.4 lib/dragonfly/whitelist.rb