Class: Dragonfly::Whitelist

Inherits:
Object show all
Extended by:
Forwardable
Defined in:
lib/dragonfly/whitelist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(patterns = []) ⇒ Whitelist



8
9
10
# File 'lib/dragonfly/whitelist.rb', line 8

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

Instance Attribute Details

#patternsObject (readonly)

Returns the value of attribute patterns



12
13
14
# File 'lib/dragonfly/whitelist.rb', line 12

def patterns
  @patterns
end

Instance Method Details

#include?(string) ⇒ Boolean



14
15
16
# File 'lib/dragonfly/whitelist.rb', line 14

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