Class: Reginald::Collection

Inherits:
Array
  • Object
show all
Defined in:
lib/rack/mount/vendor/reginald/reginald/collection.rb

Direct Known Subclasses

Alternation, Expression

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object

:nodoc:



20
21
22
23
24
25
26
27
28
29
# File 'lib/rack/mount/vendor/reginald/reginald/collection.rb', line 20

def ==(other) #:nodoc:
  case other
  when String
    other == to_s
  when Array
    super
  else
    eql?(other)
  end
end

#eql?(other) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


31
32
33
# File 'lib/rack/mount/vendor/reginald/reginald/collection.rb', line 31

def eql?(other) #:nodoc:
  other.instance_of?(self.class) && super
end

#freezeObject

:nodoc:



35
36
37
38
# File 'lib/rack/mount/vendor/reginald/reginald/collection.rb', line 35

def freeze #:nodoc:
  each { |e| e.freeze }
  super
end

#ignorecase=(ignorecase) ⇒ Object



3
4
5
6
# File 'lib/rack/mount/vendor/reginald/reginald/collection.rb', line 3

def ignorecase=(ignorecase)
  each { |e| e.ignorecase = ignorecase }
  ignorecase
end

#include?(char) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/rack/mount/vendor/reginald/reginald/collection.rb', line 16

def include?(char)
  any? { |e| e.include?(char) }
end

#match(char) ⇒ Object



12
13
14
# File 'lib/rack/mount/vendor/reginald/reginald/collection.rb', line 12

def match(char)
  to_regexp.match(char)
end

#to_regexpObject



8
9
10
# File 'lib/rack/mount/vendor/reginald/reginald/collection.rb', line 8

def to_regexp
  Regexp.compile("\\A#{to_s(true)}\\Z", options)
end