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:



15
16
17
18
19
20
21
22
23
24
# File 'lib/rack/mount/vendor/reginald/reginald/collection.rb', line 15

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

#eql?(other) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


26
27
28
# File 'lib/rack/mount/vendor/reginald/reginald/collection.rb', line 26

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

#freezeObject

:nodoc:



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

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

#include?(char) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#match(char) ⇒ Object



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

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

#to_regexpObject



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

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